
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <link rel="canonical" href="https://blog.csdn.net/dkm123456/article/details/117675468"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="report" content='{"pid": "blog", "spm":"1001.2101"}'>
    <meta name="referrer" content="always">
    <meta http-equiv="Cache-Control" content="no-siteapp" /><link rel="alternate" media="handheld" href="#" />
    <meta name="shenma-site-verification" content="5a59773ab8077d4a62bf469ab966a63b_1497598848">
    <meta name="applicable-device" content="pc">
    <link  href="https://g.csdnimg.cn/static/logo/favicon32.ico"  rel="shortcut icon" type="image/x-icon" />
    <title>Java俄罗斯方块，老程序员花了一个周末，连接中学年代！_编程界明世隐的博客-CSDN博客</title>
    <script>
      (function(){ 
        var el = document.createElement("script"); 
        el.src = "https://s3a.pstatp.com/toutiao/push.js?1abfa13dfe74d72d41d83c86d240de427e7cac50c51ead53b2e79d40c7952a23ed7716d05b4a0f683a653eab3e214672511de2457e74e99286eb2c33f4428830"; 
        el.id = "ttzz"; 
        var s = document.getElementsByTagName("script")[0]; 
        s.parentNode.insertBefore(el, s);
      })(window)
    </script>
        <meta name="keywords" content="Java俄罗斯方块，老程序员花了一个周末，连接中学年代！">
        <meta name="csdn-baidu-search"  content='{"autorun":true,"install":true,"keyword":"Java俄罗斯方块，老程序员花了一个周末，连接中学年代！"}'>
    <meta name="description" content="引言：俄罗斯方块，相信很多80、90后的小伙伴都玩过，也是当年非常火的游戏，当年读中学的时候，有一个同学有这个游戏机，大家都很喜欢玩，这个游戏给当时的我们带来了很多欢乐，时光飞逝，感慨颇多！人终归是要长大的，回忆再美好，日子也一去不复返了，以前我们只会玩游戏，心里想自己能做一个出来多牛逼啊，长大后，成为程序员的我们有能力自己写游戏玩，我想这就是成长吧！玩过这个游戏机的小伙伴看到这个图，应该对这个机器多少有些感情，毕竟带给了我们很多的欢乐！这次利用周末的时间，去写了一个俄罗斯方块Java版本，感觉碰">
    <script src="//g.csdnimg.cn/tingyun/1.8.5/blog.js" type='text/javascript'></script>
        <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/release/blogv2/dist/pc/css/detail_enter-049c37bb43.min.css">
    <style>
        #content_views{
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none; 
            user-select: none; 
        }
    </style>
    <style>
        #content_views pre{
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none; 
            user-select: none; 
        }
        #content_views pre code{
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none; 
            user-select: none; 
        }
    </style>
    <script type="application/ld+json">{"@context":"https://ziyuan.baidu.com/contexts/cambrian.jsonld","@id":"https://blog.csdn.net/dkm123456/article/details/117675468","appid":"1638831770136827","pubDate":"2021-06-07T21:51:31","title":"Java俄罗斯方块，老程序员花了一个周末，连接中学年代！_编程界明世隐的博客-CSDN博客","upDate":"2021-06-08T08:32:02"}</script>
        <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/release/blogv2/dist/pc/themesSkin/skin-cat/skin-cat-d114b9ac23.min.css">
    <script src="https://csdnimg.cn/public/common/libs/jquery/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var isCorporate = false;//注释删除enterprise
        var username =  "dkm123456";
        var skinImg = "white";
        var blog_address = "https://blog.csdn.net/dkm123456";
        var currentUserName = "";
        var isOwner = false;
        var loginUrl = "http://passport.csdn.net/account/login?from=https://blog.csdn.net/dkm123456/article/details/117675468";
        var blogUrl = "https://blog.csdn.net/";
        var avatar = "https://profile.csdnimg.cn/6/E/C/3_dkm123456";
        var articleTitle = "Java俄罗斯方块，老程序员花了一个周末，连接中学年代！";
        var articleDesc = "引言：俄罗斯方块，相信很多80、90后的小伙伴都玩过，也是当年非常火的游戏，当年读中学的时候，有一个同学有这个游戏机，大家都很喜欢玩，这个游戏给当时的我们带来了很多欢乐，时光飞逝，感慨颇多！人终归是要长大的，回忆再美好，日子也一去不复返了，以前我们只会玩游戏，心里想自己能做一个出来多牛逼啊，长大后，成为程序员的我们有能力自己写游戏玩，我想这就是成长吧！玩过这个游戏机的小伙伴看到这个图，应该对这个机器多少有些感情，毕竟带给了我们很多的欢乐！这次利用周末的时间，去写了一个俄罗斯方块Java版本，感觉碰";
        var articleTitles = "Java俄罗斯方块，老程序员花了一个周末，连接中学年代！_编程界明世隐的博客-CSDN博客";
        var nickName = "编程界明世隐";
        var articleDetailUrl = "https://blog.csdn.net/dkm123456/article/details/117675468";
        if(window.location.host.split('.').length == 3) {
            blog_address = blogUrl + username;
        }
        var skinStatus = "White";
        var blogStaticHost = "https://csdnimg.cn/release/blogv2/"
    </script>
    <script src="https://g.csdnimg.cn/??fixed-sidebar/1.1.6/fixed-sidebar.js" type="text/javascript"></script>
    <script src='//g.csdnimg.cn/common/csdn-report/report.js' type='text/javascript'></script>
    <link rel="stylesheet" type="text/css" href="https://csdnimg.cn/public/sandalstrap/1.4/css/sandalstrap.min.css">
    <style>
        .MathJax, .MathJax_Message, .MathJax_Preview{
            display: none
        }
    </style>
    <script src="https://dup.baidustatic.com/js/ds.js"></script>
</head>
<body class="nodata " style="">
        <script>
            var toolbarSearchExt = '{"landingWord":[],"queryWord":"","tag":["java","游戏","俄罗斯方块","swing"],"title":"Java俄罗斯方块，老程序员花了一个周末，连接中学年代！"}';
        </script>
    <script src="https://g.csdnimg.cn/common/csdn-toolbar/csdn-toolbar.js" type="text/javascript"></script>
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/pc/css/blog_code-01256533b5.min.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/chart-3456820cac.css" />
<div class="main_father clearfix d-flex justify-content-center" style="height:100%;"> 
    <div class="container clearfix" id="mainBox">
        <main>
<script type="text/javascript">
    function getQueryString(name) {   
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象  
      var r = window.location.search.substr(1).match(reg);  //匹配目标参数
      if( r != null ) return decodeURIComponent( r[2] ); return '';   
    }
    function stripscript(s){ 
      var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）——|{}【】‘；：”“'。，、？%]") 
      var rs = ""; 
      for (var i = 0; i < s.length; i++) { 
        rs = rs+s.substr(i, 1).replace(pattern, ''); 
      } 
      return rs; 
    }
    var blogHotWords = stripscript(getQueryString('utm_term')).length > 1 ? stripscript(getQueryString('utm_term')) : ''
</script>
<div class="blog-content-box">
        <div class="article-header-box">
        <div class="article-header">
            <div class="article-title-box">
                <h1 class="title-article" id="articleContentId">Java俄罗斯方块，老程序员花了一个周末，连接中学年代！</h1>
            </div>
            <div class="article-info-box">
                <div class="article-bar-top">
                    <img class="article-type-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/original.png" alt="">
                    <div class="bar-content">
                        <span class="c-gray">置顶</span>
                    <a class="follow-nickName " href="https://blog.csdn.net/dkm123456" target="_blank" rel="noopener">编程界明世隐</a>
                    <span class="time">2021-06-08 08:32:02</span>
                    <img class="article-read-img article-heard-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/articleReadEyes.png" alt="">
                    <span class="read-count">126767</span>
                    <a id="blog_detail_zk_collection" class="un-collection" data-report-click='{"mod":"popu_823","spm":"1001.2101.3001.4232","ab":"new"}'>
                        <img class="article-collect-img article-heard-img un-collect-status isdefault" style="display:inline-block" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollect.png" alt="">
                        <img class="article-collect-img article-heard-img collect-status isactive" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollectionActive.png" alt="">
                        <span class="name">收藏</span>
                        <span class="get-collection">
                            2175
                        </span>
                    </a>
                    </div>
                </div>
                <div class="blog-tags-box">
                    <div class="tags-box artic-tag-box">
                            <span class="label">分类专栏：</span>
                                <a class="tag-link" href="https://blog.csdn.net/dkm123456/category_10722701.html" target="_blank" rel="noopener">java项目实战</a>
                                <a class="tag-link" href="https://blog.csdn.net/dkm123456/category_11085592.html" target="_blank" rel="noopener">Java游戏实例大全</a>
                            <span class="label">文章标签：</span>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"java","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/NtTaIg5sMzYyLWJsb2cO0O0O.html" target="_blank" rel="noopener">java</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"游戏","ab":"new"}' class="tag-link" href="https://so.csdn.net/so/search/s.do?q=游戏&amp;t=blog&amp;o=vip&amp;s=&amp;l=&amp;f=&amp;viparticle=" target="_blank" rel="noopener">游戏</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"俄罗斯方块","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/OtTaIg5sMjY0MjktYmxvZwO0O0OO0O0O.html" target="_blank" rel="noopener">俄罗斯方块</a>
                                <a data-report-click='{"mod":"popu_626","spm":"1001.2101.3001.4223","strategy":"swing","ab":"new"}' class="tag-link" href="https://www.csdn.net/tags/MtTaEg0sNTA4NTEtYmxvZwO0O0OO0O0O.html" target="_blank" rel="noopener">swing</a>
                            <a class="origin-plan-box" data-report-click='{"spm":"1001.2101.3001.5794"}' href="https://marketing.csdn.net/p/55d59e00e66e4d3796149b096ae7c810" target="_blank">
                                <img src="https://csdnimg.cn/release/blogv2/dist/components/img/originPlan.png" alt=""><span class="origin-plan-name">原力计划</span>
                            </a>
                    </div>
                </div>
                <div class="slide-content-box">
                    <div class="article-copyright">
                        <div class="creativecommons">
                            版权声明：本文为博主原创文章，遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版权协议，转载请附上原文出处链接和本声明。
                        </div>
                        <div class="article-source-link">
                            本文链接：<a href="https://blog.csdn.net/dkm123456/article/details/117675468" target="_blank">https://blog.csdn.net/dkm123456/article/details/117675468</a>
                        </div>
                    </div>
                </div>
                <div class="operating">
                    <a class="href-article-edit slide-toggle">版权</a>
                </div>
            </div>
        </div>
    </div>
        <div id="blogColumnPayAdvert">
            <div class="column-group">
                <div class="column-group-item column-group0 ">
                    <div class="item-l">
                        <a class="item-target" href="https://blog.csdn.net/dkm123456/category_11085592.html" target="_blank" title="Java游戏实例大全"
                        data-report-view='{"spm":"1001.2101.3001.6332"}'
                        data-report-click='{"spm":"1001.2101.3001.6332"}'>
                            <img class="item-target" src="https://img-blog.csdnimg.cn/20210723110743428.png?x-oss-process=image/resize,m_fixed,h_224,w_224" alt="">
                            <span class="title item-target">Java游戏实例大全</span>
                        </a>
                        <span class="dec more">同时被 2 个专栏收录<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/newArrowDown1White.png" alt=""></span>
                    </div>
                    <div class="item-m">
                        <span>12 篇文章</span>
                        <span>22 订阅</span>
                        <span class="old-add-new-box">
                            <span class="price">¥79.90</span>
                            <span class="oldprice">¥99.00</span>
                        </span>
                    </div>
                    <div class="item-r">
                                    <a class="item-target article-column-bt articleColumnBt" data-id="11085592" data-price="79.90" data-oldprice="99.00"
                                    data-report-view='{"spm":"1001.2101.3001.6333"}'
                                    data-report-click='{"spm":"1001.2101.3001.6333"}'>订阅专栏</a>
                                    <a class="item-target column-studyvip-free column-studyvip-pass">
                                        <img class="item-target column-studyvip-icon" src="https://csdnimg.cn/release/blogv2/dist/components/img/studyVipIcon.png">学习会员免费看
                                    </a>
                    </div>
                </div>
                <div class="column-group-item column-group1 ">
                    <div class="item-l">
                        <a class="item-target" href="https://blog.csdn.net/dkm123456/category_10722701.html" target="_blank" title="java项目实战"
                        data-report-view='{"spm":"1001.2101.3001.6332"}'
                        data-report-click='{"spm":"1001.2101.3001.6332"}'>
                            <img class="item-target" src="https://img-blog.csdnimg.cn/20210704165918193.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224" alt="">
                            <span class="title item-target">java项目实战</span>
                        </a>
                    </div>
                    <div class="item-m">
                        <span>19 篇文章</span>
                        <span>65 订阅</span>
                    </div>
                    <div class="item-r">
                            <a class="item-target article-column-bt articleColumnFreeBt" data-id="10722701">订阅专栏</a>
                    </div>
                </div>
            </div>
        </div>
    <article class="baidu_pl">
        <div id="article_content" class="article_content clearfix">
        <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-1a85854398.css">
                <div id="content_views" class="markdown_views prism-dracula">
                    <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
                        <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
                    </svg>
                    <p></p>
<div class="csdn-video-box">
 <iframe id="QNyGfbvc-1627698848971" src="https://live.csdn.net/v/embed/166010" allowfullscreen="true" data-mediaembed="csdn"></iframe>
 <p>Java俄罗斯方块&#xff0c;老程序员花了一个周末&#xff0c;连接中学年代&#xff01;</p>
</div>
<p></p> 
<h1><a id="_3"></a>系列目录</h1> 
<p><a href="https://blog.csdn.net/dkm123456/article/details/118904917"><u>1. Java 五子棋人机版</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117431591"><u>2. 老Java程序员花2天写了个连连看</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117265359"><u>3. 老Java程序员花一天时间写了个飞机大战</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117047116"><u>4. Java植物大战僵尸</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/118079900"><u>5. Java消消乐&#xff08;天天爱消除&#xff09;</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117933331"><u>6. Java贪吃蛇小游戏</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/116637184"><u>7. Java扫雷小游戏</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/116609629"><u>8. Java坦克大战</u></a></p> 
<h1><a id="_13"></a>引言&#xff1a;</h1> 
<p><strong>俄罗斯方块&#xff0c;相信很多<mark>80、90</mark>后的小伙伴都玩过&#xff0c;也是当年非常火的游戏&#xff0c;当年读中学的时候&#xff0c;有一个同学有这个游戏机&#xff0c;大家都很喜欢玩&#xff0c;这个游戏给当时的我们带来了很多欢乐&#xff0c;时光飞逝&#xff0c;感慨颇多&#xff01;<br /> 人终归是要长大的&#xff0c;回忆再美好&#xff0c;日子也一去不复返了&#xff0c;以前我们只会玩游戏&#xff0c;心里想自己能做一个出来多牛逼啊&#xff0c;长大后&#xff0c;成为<mark>程序员</mark>的我们有能力自己<mark>写游戏玩</mark>&#xff0c;我想这就是成长吧&#xff01;</strong><br /> <img src="https://img-blog.csdnimg.cn/20210607215451931.jpg?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <mark>玩过这个游戏机的小伙伴看到这个图&#xff0c;应该对这个机器多少有些感情&#xff0c;毕竟带给了我们很多的欢乐&#xff01;</mark></p> 
<p>这次利用周末的时间&#xff0c;去写了一个俄罗斯方块Java版本&#xff0c;感觉碰撞判断这个地方有点难处理&#xff0c;确实花了不少时间&#xff01;</p> 
<h1><a id="_20"></a>效果图</h1> 
<p>这里界面做的感觉不是很好看&#xff0c;但我觉得问题不大&#xff0c;功能到位就好&#xff01;<br /> <img src="https://img-blog.csdnimg.cn/20210607220016763.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h1><a id="_24"></a>实现思路</h1> 
<h2><a id="_25"></a>两块画布&#xff1a;</h2> 
<p><mark><strong>画布1&#xff1a;</strong></mark> 用来绘制静态东西&#xff0c;比如游戏区边框、网格、得分区域框、下一个区域框、按钮等&#xff0c;无需刷新的部分。</p> 
<p><mark><strong>画布2&#xff1a;</strong></mark> 用来绘制游戏动态的部分&#xff0c;比如 方格模型、格子的移动、旋转变形、消除、积分显示、下一个图形显示 等。</p> 
<h1><a id="_30"></a>代码实现</h1> 
<h2><a id="_31"></a>创建窗口</h2> 
<p><strong>首先创建一个游戏窗体类GameFrame&#xff0c;继承至JFrame&#xff0c;用来显示在屏幕上&#xff08;window的对象&#xff09;&#xff0c;每个游戏都有一个窗口&#xff0c;设置好窗口标题、尺寸、布局等就可以。</strong></p> 
<pre><code class="prism language-java"><span class="token comment">/*
 * 游戏窗体类
 */</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">GameFrame</span> <span class="token keyword">extends</span> <span class="token class-name">JFrame</span> <span class="token punctuation">{<!-- --></span>
	
	<span class="token keyword">public</span> <span class="token class-name">GameFrame</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token function">setTitle</span><span class="token punctuation">(</span><span class="token string">&#34;俄罗斯方块&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设置标题</span>
		<span class="token function">setSize</span><span class="token punctuation">(</span><span class="token number">488</span><span class="token punctuation">,</span> <span class="token number">476</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设定尺寸</span>
		<span class="token function">setLayout</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">BorderLayout</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">setDefaultCloseOperation</span><span class="token punctuation">(</span><span class="token class-name">JFrame</span><span class="token punctuation">.</span>EXIT_ON_CLOSE<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//点击关闭按钮是关闭程序</span>
        <span class="token function">setLocationRelativeTo</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>   <span class="token comment">//设置居中</span>
    	<span class="token function">setResizable</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">//不允许修改界面大小</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<h2><a id="1_50"></a><mark>画布1</mark></h2> 
<p><strong>创建面板容器BackPanel继承至JPanel</strong></p> 
<pre><code class="prism language-java"><span class="token comment">/*
 * 背景画布类
 */</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">BackPanel</span> <span class="token keyword">extends</span> <span class="token class-name">JPanel</span><span class="token punctuation">{<!-- --></span>
	<span class="token class-name">BackPanel</span> panel<span class="token operator">&#61;</span><span class="token keyword">this</span><span class="token punctuation">;</span>
	<span class="token keyword">private</span> <span class="token class-name">JFrame</span> mainFrame<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
	<span class="token comment">//构造里面初始化相关参数</span>
	<span class="token keyword">public</span> <span class="token class-name">BackPanel</span><span class="token punctuation">(</span><span class="token class-name">JFrame</span> frame<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setLayout</span><span class="token punctuation">(</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setOpaque</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>mainFrame <span class="token operator">&#61;</span> frame<span class="token punctuation">;</span>
		mainFrame<span class="token punctuation">.</span><span class="token function">setVisible</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><strong>再创建一个Main类&#xff0c;来启动这个窗口。</strong></p> 
<pre><code class="prism language-java"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Main</span> <span class="token punctuation">{<!-- --></span>
	<span class="token comment">//主类</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token class-name">GameFrame</span> frame <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">GameFrame</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">BackPanel</span> panel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">BackPanel</span><span class="token punctuation">(</span>frame<span class="token punctuation">)</span><span class="token punctuation">;</span>
		frame<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>panel<span class="token punctuation">)</span><span class="token punctuation">;</span>
		frame<span class="token punctuation">.</span><span class="token function">setVisible</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设定显示</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><strong>右键执行这个Main类&#xff0c;窗口建出来了</strong><br /> <img src="https://img-blog.csdnimg.cn/20210607221726949.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h2><a id="_84"></a>创建菜单及菜单选项</h2> 
<p><strong>创建菜单</strong></p> 
<pre><code class="prism language-java"><span class="token keyword">private</span> <span class="token keyword">void</span>  <span class="token function">initMenu</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token comment">// 创建菜单及菜单选项</span>
		jmb <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenuBar</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">JMenu</span> jm1 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenu</span><span class="token punctuation">(</span><span class="token string">&#34;游戏&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jm1<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// 设置菜单显示的字体</span>
		<span class="token class-name">JMenu</span> jm2 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenu</span><span class="token punctuation">(</span><span class="token string">&#34;帮助&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jm2<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// 设置菜单显示的字体</span>
		
		<span class="token class-name">JMenuItem</span> jmi1 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenuItem</span><span class="token punctuation">(</span><span class="token string">&#34;开始新游戏&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">JMenuItem</span> jmi2 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenuItem</span><span class="token punctuation">(</span><span class="token string">&#34;退出&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi1<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi2<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token class-name">JMenuItem</span> jmi3 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenuItem</span><span class="token punctuation">(</span><span class="token string">&#34;操作说明&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi3<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">JMenuItem</span> jmi4 <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JMenuItem</span><span class="token punctuation">(</span><span class="token string">&#34;失败判定&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi4<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;仿宋&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">15</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		jm1<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jmi1<span class="token punctuation">)</span><span class="token punctuation">;</span>
		jm1<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jmi2<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		jm2<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jmi3<span class="token punctuation">)</span><span class="token punctuation">;</span>
		jm2<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jmi4<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		jmb<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jm1<span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmb<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>jm2<span class="token punctuation">)</span><span class="token punctuation">;</span>
		mainFrame<span class="token punctuation">.</span><span class="token function">setJMenuBar</span><span class="token punctuation">(</span>jmb<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">// 菜单Bar放到JFrame上</span>
		jmi1<span class="token punctuation">.</span><span class="token function">addActionListener</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi1<span class="token punctuation">.</span><span class="token function">setActionCommand</span><span class="token punctuation">(</span><span class="token string">&#34;Restart&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi2<span class="token punctuation">.</span><span class="token function">addActionListener</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi2<span class="token punctuation">.</span><span class="token function">setActionCommand</span><span class="token punctuation">(</span><span class="token string">&#34;Exit&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		jmi3<span class="token punctuation">.</span><span class="token function">addActionListener</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi3<span class="token punctuation">.</span><span class="token function">setActionCommand</span><span class="token punctuation">(</span><span class="token string">&#34;help&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi4<span class="token punctuation">.</span><span class="token function">addActionListener</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		jmi4<span class="token punctuation">.</span><span class="token function">setActionCommand</span><span class="token punctuation">(</span><span class="token string">&#34;lost&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
</code></pre> 
<p><strong>实现ActionListener并重写方法actionPerformed</strong><br /> <img src="https://img-blog.csdnimg.cn/20210607222444575.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <strong><mark>actionPerformed方法的实现</mark></strong><br /> <img src="https://img-blog.csdnimg.cn/20210607222744362.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <img src="https://img-blog.csdnimg.cn/20210607222835196.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /></p> 
<h2><a id="_131"></a>绘制游戏区域</h2> 
<p><strong>绘制游戏区域边框</strong></p> 
<pre><code class="prism language-java"><span class="token comment">//绘制边框</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">drawBorder</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">BasicStroke</span> bs_2<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">BasicStroke</span><span class="token punctuation">(</span><span class="token number">12L</span><span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>CAP_ROUND<span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>JOIN_MITER<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token class-name">Graphics2D</span> g_2d<span class="token operator">&#61;</span><span class="token punctuation">(</span><span class="token class-name">Graphics2D</span><span class="token punctuation">)</span>g<span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setColor</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Color</span><span class="token punctuation">(</span><span class="token number">128</span><span class="token punctuation">,</span><span class="token number">128</span><span class="token punctuation">,</span><span class="token number">128</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setStroke</span><span class="token punctuation">(</span>bs_2<span class="token punctuation">)</span><span class="token punctuation">;</span>

	<span class="token class-name">RoundRectangle2D<span class="token punctuation">.</span>Double</span> rect <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">RoundRectangle2D<span class="token punctuation">.</span>Double</span><span class="token punctuation">(</span><span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">313</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">413</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">draw</span><span class="token punctuation">(</span>rect<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><strong>绘制右边辅助区域&#xff08;积分、下一个、按钮等&#xff09;</strong></p> 
<pre><code class="prism language-java"><span class="token comment">//绘制右边区域边框</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">drawBorderRight</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">BasicStroke</span> bs_2<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">BasicStroke</span><span class="token punctuation">(</span><span class="token number">12L</span><span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>CAP_ROUND<span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>JOIN_MITER<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token class-name">Graphics2D</span> g_2d<span class="token operator">&#61;</span><span class="token punctuation">(</span><span class="token class-name">Graphics2D</span><span class="token punctuation">)</span>g<span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setColor</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Color</span><span class="token punctuation">(</span><span class="token number">128</span><span class="token punctuation">,</span><span class="token number">128</span><span class="token punctuation">,</span><span class="token number">128</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setStroke</span><span class="token punctuation">(</span>bs_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token class-name">RoundRectangle2D<span class="token punctuation">.</span>Double</span> rect <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">RoundRectangle2D<span class="token punctuation">.</span>Double</span><span class="token punctuation">(</span><span class="token number">336</span><span class="token punctuation">,</span> <span class="token number">6</span><span class="token punctuation">,</span> <span class="token number">140</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">413</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">draw</span><span class="token punctuation">(</span>rect<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token comment">//g_2d.drawRect(336, 6, 140, 413);</span>
<span class="token punctuation">}</span>
</code></pre> 
<p>在BackPanel 中重写paint 方法&#xff0c;并调用刚才两个区域绘制方法。<br /> <img src="https://img-blog.csdnimg.cn/20210607225131296.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <img src="https://img-blog.csdnimg.cn/20210607224917135.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> <strong>绘制得分区域和下一个区域</strong></p> 
<pre><code class="prism language-java"><span class="token comment">//绘制积分区域</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">drawCount</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">BasicStroke</span> bs_2<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">BasicStroke</span><span class="token punctuation">(</span><span class="token number">2L</span><span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>CAP_ROUND<span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>JOIN_MITER<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token class-name">Graphics2D</span> g_2d<span class="token operator">&#61;</span><span class="token punctuation">(</span><span class="token class-name">Graphics2D</span><span class="token punctuation">)</span>g<span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setColor</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Color</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setStroke</span><span class="token punctuation">(</span>bs_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">drawRect</span><span class="token punctuation">(</span><span class="token number">350</span><span class="token punctuation">,</span> <span class="token number">17</span><span class="token punctuation">,</span> <span class="token number">110</span><span class="token punctuation">,</span> <span class="token number">80</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token comment">//得分</span>
	g<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;宋体&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g<span class="token punctuation">.</span><span class="token function">drawString</span><span class="token punctuation">(</span><span class="token string">&#34;得分&#xff1a;&#34;</span><span class="token punctuation">,</span><span class="token number">380</span><span class="token punctuation">,</span> <span class="token number">40</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>

<span class="token comment">//绘制下一个区域</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">drawNext</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">BasicStroke</span> bs_2<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">BasicStroke</span><span class="token punctuation">(</span><span class="token number">2L</span><span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>CAP_ROUND<span class="token punctuation">,</span><span class="token class-name">BasicStroke</span><span class="token punctuation">.</span>JOIN_MITER<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token class-name">Graphics2D</span> g_2d<span class="token operator">&#61;</span><span class="token punctuation">(</span><span class="token class-name">Graphics2D</span><span class="token punctuation">)</span>g<span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setColor</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Color</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setStroke</span><span class="token punctuation">(</span>bs_2<span class="token punctuation">)</span><span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">drawRect</span><span class="token punctuation">(</span><span class="token number">350</span><span class="token punctuation">,</span> <span class="token number">120</span><span class="token punctuation">,</span> <span class="token number">110</span><span class="token punctuation">,</span> <span class="token number">120</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token comment">//得分</span>
	g<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;宋体&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>BOLD<span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	g<span class="token punctuation">.</span><span class="token function">drawString</span><span class="token punctuation">(</span><span class="token string">&#34;下一个&#xff1a;&#34;</span><span class="token punctuation">,</span><span class="token number">360</span><span class="token punctuation">,</span> <span class="token number">140</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><strong><mark>绘制网格&#xff08;15列 20行&#xff09;</mark></strong></p> 
<pre><code class="prism language-java"><span class="token comment">//绘制网格</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">drawGrid</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">Graphics2D</span> g_2d<span class="token operator">&#61;</span><span class="token punctuation">(</span><span class="token class-name">Graphics2D</span><span class="token punctuation">)</span>g<span class="token punctuation">;</span>
	g_2d<span class="token punctuation">.</span><span class="token function">setColor</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Color</span><span class="token punctuation">(</span><span class="token number">255</span><span class="token punctuation">,</span><span class="token number">255</span><span class="token punctuation">,</span><span class="token number">255</span><span class="token punctuation">,</span><span class="token number">150</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> x1<span class="token operator">&#61;</span><span class="token number">12</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> y1<span class="token operator">&#61;</span><span class="token number">20</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> x2<span class="token operator">&#61;</span><span class="token number">312</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> y2<span class="token operator">&#61;</span><span class="token number">20</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;&#61;</span> ROWS<span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		y1 <span class="token operator">&#61;</span> <span class="token number">12</span> <span class="token operator">&#43;</span> <span class="token number">20</span><span class="token operator">*</span>i<span class="token punctuation">;</span>
		y2 <span class="token operator">&#61;</span> <span class="token number">12</span> <span class="token operator">&#43;</span> <span class="token number">20</span><span class="token operator">*</span>i<span class="token punctuation">;</span>
		g_2d<span class="token punctuation">.</span><span class="token function">drawLine</span><span class="token punctuation">(</span>x1<span class="token punctuation">,</span> y1<span class="token punctuation">,</span> x2<span class="token punctuation">,</span> y2<span class="token punctuation">)</span><span class="token punctuation">;</span>		
	<span class="token punctuation">}</span>
	
	y1<span class="token operator">&#61;</span><span class="token number">12</span><span class="token punctuation">;</span>
	y2<span class="token operator">&#61;</span><span class="token number">412</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;&#61;</span> COLS<span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		x1 <span class="token operator">&#61;</span> <span class="token number">12</span> <span class="token operator">&#43;</span> <span class="token number">20</span><span class="token operator">*</span>i<span class="token punctuation">;</span>
		x2 <span class="token operator">&#61;</span> <span class="token number">12</span> <span class="token operator">&#43;</span> <span class="token number">20</span><span class="token operator">*</span>i<span class="token punctuation">;</span>
		g_2d<span class="token punctuation">.</span><span class="token function">drawLine</span><span class="token punctuation">(</span>x1<span class="token punctuation">,</span> y1<span class="token punctuation">,</span> x2<span class="token punctuation">,</span> y2<span class="token punctuation">)</span><span class="token punctuation">;</span>		
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><mark>在paint方法中调用</mark><br /> <img src="https://img-blog.csdnimg.cn/20210607225629598.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <mark>创建游戏右边区域的一个暂停按钮</mark></p> 
<pre><code class="prism language-java"><span class="token comment">//初始化</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token comment">// 开始/停止按钮</span>
	btnStart <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">JButton</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setFont</span><span class="token punctuation">(</span><span class="token keyword">new</span> <span class="token class-name">Font</span><span class="token punctuation">(</span><span class="token string">&#34;黑体&#34;</span><span class="token punctuation">,</span> <span class="token class-name">Font</span><span class="token punctuation">.</span>PLAIN<span class="token punctuation">,</span> <span class="token number">18</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setFocusPainted</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span><span class="token string">&#34;暂停&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setBounds</span><span class="token punctuation">(</span><span class="token number">360</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">,</span> <span class="token number">80</span><span class="token punctuation">,</span> <span class="token number">43</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setBorder</span><span class="token punctuation">(</span><span class="token class-name">BorderFactory</span><span class="token punctuation">.</span><span class="token function">createRaisedBevelBorder</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>btnStart<span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">addActionListener</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	btnStart<span class="token punctuation">.</span><span class="token function">setActionCommand</span><span class="token punctuation">(</span><span class="token string">&#34;start&#34;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20210607225914977.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> <mark>此时基本布局已经完成了。</mark></p> 
<h2><a id="2_241"></a><mark>画布2</mark></h2> 
<p><strong>GamePanel 继承至 JPanel 并重写 paint 方法</strong><br /> <mark>修改Main类&#xff0c;将画布2也放到窗口中</mark></p> 
<pre><code class="prism language-java"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Main</span> <span class="token punctuation">{<!-- --></span>
	<span class="token comment">//主类</span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token class-name">GameFrame</span> frame <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">GameFrame</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">BackPanel</span> panel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">BackPanel</span><span class="token punctuation">(</span>frame<span class="token punctuation">)</span><span class="token punctuation">;</span>
		frame<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>panel<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">GamePanel</span> gamePanel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">GamePanel</span><span class="token punctuation">(</span>frame<span class="token punctuation">)</span><span class="token punctuation">;</span>
		panel<span class="token punctuation">.</span><span class="token function">setGamePanel</span><span class="token punctuation">(</span>gamePanel<span class="token punctuation">)</span><span class="token punctuation">;</span>
		frame<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>gamePanel<span class="token punctuation">)</span><span class="token punctuation">;</span>
		frame<span class="token punctuation">.</span><span class="token function">setVisible</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//设定显示</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<h2><a id="2_258"></a>画布2绘制一个小方块</h2> 
<p><strong>因为游戏区域被分成了一个个的小格子&#xff0c;每个小格子就是一个单位&#xff0c;整个网格就是一个15,、20的二维数组。<br /> 于是第一行第一个元素&#xff0c;用数组下标来表示就是 0,0 、第一行第二个元素就是0、1<br /> 这样就好办了&#xff0c;我们创建一个Block类&#xff0c;设置坐标和宽高即可绘制方块&#xff08;宽高为固定20&#xff0c;与网格对应&#xff09;。</strong></p> 
<pre><code class="prism language-java"><span class="token keyword">package</span> <span class="token namespace">main</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">java<span class="token punctuation">.</span>awt<span class="token punctuation">.</span></span><span class="token class-name">Graphics</span><span class="token punctuation">;</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Block</span> <span class="token punctuation">{<!-- --></span>
	<span class="token keyword">private</span> <span class="token keyword">int</span> x<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token comment">//x坐标</span>
	<span class="token keyword">private</span> <span class="token keyword">int</span> y<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span><span class="token comment">//y坐标</span>
	<span class="token keyword">private</span> <span class="token class-name">GamePanel</span> panel<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
	
	<span class="token keyword">public</span> <span class="token class-name">Block</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">,</span><span class="token keyword">int</span> y<span class="token punctuation">,</span><span class="token keyword">int</span> mX<span class="token punctuation">,</span><span class="token keyword">int</span> mY<span class="token punctuation">,</span><span class="token class-name">GamePanel</span> panel<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>x<span class="token operator">&#61;</span>x<span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>y<span class="token operator">&#61;</span>y<span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>panel<span class="token operator">&#61;</span>panel<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token comment">//绘制</span>
	<span class="token keyword">void</span> <span class="token function">draw</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		g<span class="token punctuation">.</span><span class="token function">fillRect</span><span class="token punctuation">(</span><span class="token number">12</span><span class="token operator">&#43;</span>x<span class="token operator">*</span><span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">12</span><span class="token operator">&#43;</span>y<span class="token operator">*</span><span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	
	<span class="token keyword">public</span> <span class="token keyword">int</span> <span class="token function">getX</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">return</span> x<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setX</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>x <span class="token operator">&#61;</span> x<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">public</span> <span class="token keyword">int</span> <span class="token function">getY</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">return</span> y<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">setY</span><span class="token punctuation">(</span><span class="token keyword">int</span> y<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>y <span class="token operator">&#61;</span> y<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><mark>实例化这个类&#xff0c;并在paint方法中调用draw绘制方法</mark></p> 
<pre><code class="prism language-java"><span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	x<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	y<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	curBlock <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Block</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span> y<span class="token punctuation">,</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<pre><code class="prism language-java"><span class="token annotation punctuation">&#64;Override</span>
<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">paint</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token keyword">super</span><span class="token punctuation">.</span><span class="token function">paint</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token keyword">if</span><span class="token punctuation">(</span>curBlock<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		curBlock<span class="token punctuation">.</span><span class="token function">draw</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>	
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/2021060723223877.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> 在Block类加入移动方法<br /> 两个参数 <mark>boolean xDir, int step</mark><br /> xDir 布尔值&#xff1a;true表示横向移动&#xff0c;false表示向下移动<br /> step是步数&#xff1a;当xDir为true&#xff0c;我们设定为 1 和 -1 横向移动1表示向右&#xff0c;-1表示向左移动&#xff1b;当xDir为true为false&#xff0c;向下移动为1&#xff08;因为不能向上移动&#xff09;。</p> 
<pre><code class="prism language-java"><span class="token comment">//移动</span>
	<span class="token keyword">void</span> <span class="token function">move</span><span class="token punctuation">(</span><span class="token keyword">boolean</span> xDir<span class="token punctuation">,</span> <span class="token keyword">int</span> step<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>xDir<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span><span class="token comment">//X方向的移动&#xff0c;step 正数向右 负数向左</span>
			x <span class="token operator">&#43;&#61;</span> step<span class="token punctuation">;</span>
		<span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{<!-- --></span><span class="token comment">//向下运动</span>
			y <span class="token operator">&#43;&#61;</span> step<span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
		panel<span class="token punctuation">.</span><span class="token function">repaint</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
</code></pre> 
<p><mark>GamePanel添加键盘事件</mark></p> 
<pre><code class="prism language-java"><span class="token comment">//添加键盘监听</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">createKeyListener</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">KeyAdapter</span> l <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">KeyAdapter</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token comment">//按下</span>
		<span class="token annotation punctuation">&#64;Override</span>
		<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">keyPressed</span><span class="token punctuation">(</span><span class="token class-name">KeyEvent</span> e<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			<span class="token keyword">int</span> key <span class="token operator">&#61;</span> e<span class="token punctuation">.</span><span class="token function">getKeyCode</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">switch</span> <span class="token punctuation">(</span>key<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
				<span class="token comment">//空格</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_SPACE<span class="token operator">:</span>
					<span class="token keyword">break</span><span class="token punctuation">;</span>
					
				<span class="token comment">//向上</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_UP<span class="token operator">:</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_W<span class="token operator">:</span>
					<span class="token keyword">break</span><span class="token punctuation">;</span>
					
				<span class="token comment">//向右	</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_RIGHT<span class="token operator">:</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_D<span class="token operator">:</span>
					<span class="token keyword">if</span><span class="token punctuation">(</span>curBlock<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span> curBlock<span class="token punctuation">.</span><span class="token function">move</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
					<span class="token keyword">break</span><span class="token punctuation">;</span>
					
				<span class="token comment">//向下</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_DOWN<span class="token operator">:</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_S<span class="token operator">:</span>
					<span class="token keyword">if</span><span class="token punctuation">(</span>curBlock<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span> curBlock<span class="token punctuation">.</span><span class="token function">move</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
					<span class="token keyword">break</span><span class="token punctuation">;</span>
					
				<span class="token comment">//向左</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_LEFT<span class="token operator">:</span>
				<span class="token keyword">case</span> <span class="token class-name">KeyEvent</span><span class="token punctuation">.</span>VK_A<span class="token operator">:</span>
					<span class="token keyword">if</span><span class="token punctuation">(</span>curBlock<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span> curBlock<span class="token punctuation">.</span><span class="token function">move</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
					<span class="token keyword">break</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
		
		<span class="token punctuation">}</span>
		<span class="token comment">//松开</span>
		<span class="token annotation punctuation">&#64;Override</span>
		<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">keyReleased</span><span class="token punctuation">(</span><span class="token class-name">KeyEvent</span> e<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token punctuation">}</span>
		
	<span class="token punctuation">}</span><span class="token punctuation">;</span>
	<span class="token comment">//给主frame添加键盘监听</span>
	mainFrame<span class="token punctuation">.</span><span class="token function">addKeyListener</span><span class="token punctuation">(</span>l<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><mark>于是我操作一波</mark><br /> <img src="https://img-blog.csdnimg.cn/20210607234047425.gif#pic_center" alt="在这里插入图片描述" /></p> 
<h2><a id="_385"></a>创建图形</h2> 
<p><mark>七种图形</mark><br /> <img src="https://img-blog.csdnimg.cn/20210607234330921.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> 如上图&#xff0c;如果我们以标红的小方块为原点&#xff08;0,0&#xff09;那我们分析一下图形其他几个方块的位置。<br /> <img src="https://img-blog.csdnimg.cn/20210607235240206.png" alt="在这里插入图片描述" /><br /> 比如上面图形&#xff0c;红色框住的为&#xff08;0,0&#xff09;的话&#xff0c;那最前面的那个是不是&#xff08;-1,0&#xff09;&#xff0c;因为 y 他们是一样的&#xff0c;只要 x 往左边移动一个位置。<br /> 以此类推&#xff0c;第3个应该是&#xff08;1,0&#xff09;&#xff0c;第4个是&#xff08;2,0&#xff09;。<br /> <img src="https://img-blog.csdnimg.cn/2021060723550855.png" alt="在这里插入图片描述" /><br /> 此图形呢&#xff0c;标红的为&#xff08;0,0&#xff09;&#xff0c;它正下方的那个应该是&#xff08;0,1&#xff09;&#xff0c;它右边那个是&#xff08;1,0&#xff09;&#xff0c;它右下角的那个应该是&#xff08;1,1&#xff09;<br /> <mark>于是我们可以设计一个Data类&#xff0c;专门存储7种图形的位置信息&#xff0c;分别对应前面图的7种模型</mark></p> 
<pre><code class="prism language-java"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Data</span> <span class="token punctuation">{<!-- --></span>
	<span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token class-name">List</span> datas <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> 
	<span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data1 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data1<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data2 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data2<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data3 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data3<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data4 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data4<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data5 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data5<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data6 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data6<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data7 <span class="token operator">&#61;</span> <span class="token punctuation">{<!-- --></span><span class="token punctuation">{<!-- --></span><span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">0</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">}</span><span class="token punctuation">,</span><span class="token punctuation">{<!-- --></span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token punctuation">;</span> 
		datas<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>data7<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<h2><a id="_423"></a>创建模型类</h2> 
<p><strong>其中创建的时候&#xff0c;随机从Data类里面7个数据里面取到一个&#xff0c;生成一个图形&#xff0c;根据对应二维数组作为下标来创建小方块。</strong></p> 
<pre><code class="prism language-java"><span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Model</span> <span class="token punctuation">{<!-- --></span>

	<span class="token keyword">private</span> <span class="token keyword">int</span> x<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token keyword">private</span> <span class="token keyword">int</span> y<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token keyword">private</span> <span class="token class-name">GamePanel</span> panel<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
	<span class="token keyword">private</span> <span class="token class-name">List</span> blocks <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">boolean</span> moveFlag<span class="token operator">&#61;</span><span class="token boolean">false</span><span class="token punctuation">;</span>

	<span class="token keyword">public</span> <span class="token class-name">Model</span><span class="token punctuation">(</span><span class="token keyword">int</span> x<span class="token punctuation">,</span><span class="token keyword">int</span> y<span class="token punctuation">,</span><span class="token class-name">GamePanel</span> panel<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>x<span class="token operator">&#61;</span>x<span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>y<span class="token operator">&#61;</span>y<span class="token punctuation">;</span>
		<span class="token keyword">this</span><span class="token punctuation">.</span>panel<span class="token operator">&#61;</span>panel<span class="token punctuation">;</span>
		
		<span class="token function">createModel</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	
	<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">createModel</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token class-name">Random</span> random <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Random</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> type <span class="token operator">&#61;</span> random<span class="token punctuation">.</span><span class="token function">nextInt</span><span class="token punctuation">(</span><span class="token number">7</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment">//1-7种模型</span>
		<span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> data<span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token keyword">int</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token class-name">Data</span><span class="token punctuation">.</span>datas<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>type<span class="token punctuation">)</span><span class="token punctuation">;</span>
		
		<span class="token class-name">Block</span> block<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> mX<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token keyword">int</span> mY<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">4</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			mX <span class="token operator">&#61;</span> data<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
			mY <span class="token operator">&#61;</span> data<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
			block <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Block</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span> y<span class="token punctuation">,</span> mX <span class="token punctuation">,</span> mY<span class="token punctuation">,</span> panel<span class="token punctuation">)</span><span class="token punctuation">;</span>
			blocks<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>block<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><strong>Block也要稍微做些变动</strong><br /> <mark>需要加入偏移坐标值&#xff0c;来设定4个小方块的相对位置</mark><br /> <img src="https://img-blog.csdnimg.cn/20210608000738536.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> GamePanel类中实例化的就是Model类了&#xff0c;同时绘制的也是</p> 
<pre><code class="prism language-java">curModel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Model</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> 
<pre><code class="prism language-java"><span class="token annotation punctuation">&#64;Override</span>
<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">paint</span><span class="token punctuation">(</span><span class="token class-name">Graphics</span> g<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token keyword">super</span><span class="token punctuation">.</span><span class="token function">paint</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>
	
	<span class="token comment">//当前模型</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span>curModel<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token class-name">List</span> blocks <span class="token operator">&#61;</span> curModel<span class="token punctuation">.</span><span class="token function">getBlocks</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token class-name">Block</span> block<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> blocks<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			block <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blocks<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
			block<span class="token punctuation">.</span><span class="token function">draw</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p>我这里设定创建Model的时候x为7&#xff0c;y为3&#xff0c;于是&#xff1a;<br /> <img src="https://img-blog.csdnimg.cn/20210608001052595.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" alt="在这里插入图片描述" /><br /> <mark>图形创建好了&#xff0c;怎么去移动这个图形呢</mark><br /> 很简单就是键盘移动的时候&#xff0c;改成调用Model类的move方法了&#xff0c;此方法里面就是循环模型的4个Block实例&#xff0c;每个小块调用自己的move方法即可&#xff1a;<br /> <img src="https://img-blog.csdnimg.cn/20210608001527249.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> 效果如下&#xff1a;<br /> <img src="https://img-blog.csdnimg.cn/20210608001542214.gif#pic_center" alt="在这里插入图片描述" /></p> 
<h2><a id="_492"></a>模型旋转变形</h2> 
<p><mark>旋转万能公式 <font color="red">x&#61;-y y&#61;x</font> 这里的x、y指的是Data类里面二维数组的值&#xff0c;也就是 Block中的偏移值</mark></p> 
<p>在Block中添加变形方法</p> 
<pre><code class="prism language-java">	<span class="token comment">//变形</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">rotate</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token comment">//旋转万能公式 x&#61;-y y&#61;x</span>
		<span class="token keyword">int</span> x <span class="token operator">&#61;</span> mX<span class="token punctuation">;</span>
		mX <span class="token operator">&#61;</span> <span class="token operator">-</span>mY<span class="token punctuation">;</span>
		mY <span class="token operator">&#61;</span> x<span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
</code></pre> 
<p><mark>Model中添加变形方法&#xff0c;就是循环4个Block实例</mark><br /> 这里加入了<mark>预变形</mark>方法&#xff0c;就是要先判断能否变形&#xff0c;比如变形会出边界&#xff0c;会碰到别的方块&#xff0c;则不让变形。</p> 
<pre><code class="prism language-java"><span class="token comment">//旋转</span>
<span class="token keyword">void</span> <span class="token function">rotate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
	<span class="token keyword">boolean</span> flag <span class="token operator">&#61;</span> <span class="token boolean">true</span><span class="token punctuation">;</span><span class="token comment">//允许变形</span>
	<span class="token class-name">Block</span> block<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> blocks<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		block <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blocks<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>block<span class="token punctuation">.</span><span class="token function">preRotate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span> <span class="token comment">//有一个不让变形就不能变形</span>
			flag <span class="token operator">&#61;</span> <span class="token boolean">false</span><span class="token punctuation">;</span><span class="token comment">//不能变形</span>
			<span class="token keyword">break</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span>flag<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> blocks<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			block <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blocks<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
			block<span class="token punctuation">.</span><span class="token function">rotate</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
	panel<span class="token punctuation">.</span><span class="token function">repaint</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20210608002328742.gif#pic_center" alt="在这里插入图片描述" /></p> 
<h2><a id="_531"></a>方块累计</h2> 
<p><mark>当图形触底或者接触往下接触到其他方块时&#xff0c;会累计在下面&#xff0c;并且创建新的图形出来。</mark><br /> public Block[][] blockStack &#61; new Block[15][20];<br /> 这个二维数组用来存储累计的方块<br /> 图形触底后&#xff0c;会根据每个小block实例的位置一一对应插入到blockStack这个二维数组中。<br /> <img src="https://img-blog.csdnimg.cn/20210608002920826.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /><br /> <mark>在paint方法中加入累积块的绘制</mark></p> 
<pre><code class="prism language-java">	<span class="token comment">//累计块</span>
		<span class="token class-name">Block</span> bott <span class="token operator">&#61;</span> <span class="token keyword">null</span><span class="token punctuation">;</span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">15</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> j <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> j <span class="token operator">&lt;</span> <span class="token number">20</span><span class="token punctuation">;</span> j<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
				bott <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blockStack<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>bott<span class="token operator">!&#61;</span><span class="token keyword">null</span> <span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
					bott<span class="token punctuation">.</span><span class="token function">draw</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>
				<span class="token punctuation">}</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
</code></pre> 
<h2><a id="_552"></a>方块消除和积分</h2> 
<p><strong>1.从当前撞击的模型中取出y坐标&#xff08;注意去重&#xff09;。<br /> 2.将y进行排序&#xff0c;让位置小的排在前面&#xff0c;也就是如果消除两行的话要先消上面的那行。<br /> 2.消除当前行采用的是数据替换&#xff0c;<mark>从当前行开始&#xff0c;上一行的数据往下一行赋值&#xff0c;当前行就等于被消除了</mark>。<br /> 3.积分处理。</strong></p> 
<pre><code class="prism language-java"><span class="token comment">//消除处理</span>
<span class="token keyword">private</span> <span class="token keyword">void</span> <span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
	<span class="token class-name">Block</span> block <span class="token operator">&#61;</span> <span class="token keyword">null</span> <span class="token punctuation">;</span>
	<span class="token keyword">int</span> num<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token keyword">int</span> y<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token class-name">List</span> hasDoList<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> 
	<span class="token class-name">List</span> clearList<span class="token operator">&#61;</span><span class="token keyword">new</span> <span class="token class-name">ArrayList</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> blocks<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		block <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blocks<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
		y <span class="token operator">&#61;</span> block<span class="token punctuation">.</span><span class="token function">getY</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">&#43;</span> block<span class="token punctuation">.</span><span class="token function">getmY</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>y<span class="token operator">&lt;</span><span class="token number">0</span> <span class="token operator">||</span> y<span class="token operator">&gt;</span><span class="token number">19</span><span class="token punctuation">)</span> <span class="token keyword">continue</span><span class="token punctuation">;</span>
		
		<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>hasDoList<span class="token punctuation">.</span><span class="token function">contains</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
			hasDoList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>block<span class="token punctuation">.</span><span class="token function">clear</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
				clearList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">;</span>
				num<span class="token operator">&#43;&#43;</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span>num<span class="token operator">&#61;&#61;</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		panel<span class="token punctuation">.</span>curCount<span class="token operator">&#43;&#61;</span><span class="token number">100</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token keyword">if</span><span class="token punctuation">(</span>num<span class="token operator">&#61;&#61;</span><span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		panel<span class="token punctuation">.</span>curCount<span class="token operator">&#43;&#61;</span><span class="token number">300</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token keyword">if</span><span class="token punctuation">(</span>num<span class="token operator">&#61;&#61;</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		panel<span class="token punctuation">.</span>curCount<span class="token operator">&#43;&#61;</span><span class="token number">600</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token keyword">if</span><span class="token punctuation">(</span>num<span class="token operator">&#61;&#61;</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		panel<span class="token punctuation">.</span>curCount<span class="token operator">&#43;&#61;</span><span class="token number">1000</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
	<span class="token comment">//执行格子的消除动作</span>
	<span class="token keyword">if</span><span class="token punctuation">(</span>num<span class="token operator">&gt;</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
		<span class="token class-name">Collections</span><span class="token punctuation">.</span><span class="token function">sort</span><span class="token punctuation">(</span>clearList<span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">doClear</span><span class="token punctuation">(</span>clearList<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token comment">//执行消除</span>
<span class="token keyword">void</span> <span class="token function">doClear</span><span class="token punctuation">(</span><span class="token class-name">List</span> l<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
	<span class="token keyword">int</span> y<span class="token operator">&#61;</span><span class="token number">0</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> l<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		y <span class="token operator">&#61;</span> <span class="token class-name">Integer</span><span class="token punctuation">.</span><span class="token function">parseInt</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span>l<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token function">clearClock</span><span class="token punctuation">(</span>y<span class="token punctuation">)</span><span class="token punctuation">;</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>

<span class="token keyword">void</span> <span class="token function">clearClock</span><span class="token punctuation">(</span><span class="token keyword">int</span> y<span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
	<span class="token class-name">Block</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">[</span><span class="token punctuation">]</span> stack <span class="token operator">&#61;</span> panel<span class="token punctuation">.</span>blockStack<span class="token punctuation">;</span>
	<span class="token class-name">Block</span> block<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
	<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> <span class="token number">15</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> j <span class="token operator">&#61;</span> <span class="token number">19</span><span class="token punctuation">;</span> j <span class="token operator">&gt;&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> j<span class="token operator">--</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span><span class="token comment">//从最下面往上</span>
			<span class="token keyword">if</span><span class="token punctuation">(</span>y<span class="token operator">&gt;&#61;</span>j<span class="token operator">&amp;&amp;</span>j<span class="token operator">&gt;</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span><span class="token comment">//消除行和上方的行&#xff0c;全部往下移动&#xff0c;即这行等于上一行的数据</span>
				block <span class="token operator">&#61;</span> stack<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
				<span class="token keyword">if</span><span class="token punctuation">(</span>block<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
					block<span class="token punctuation">.</span><span class="token function">setY</span><span class="token punctuation">(</span>block<span class="token punctuation">.</span><span class="token function">getY</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">&#43;</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
				<span class="token punctuation">}</span>
				stack<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">&#61;</span>block<span class="token punctuation">;</span>
			<span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token keyword">if</span><span class="token punctuation">(</span>j<span class="token operator">&#61;&#61;</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span><span class="token comment">//第一行&#xff0c;清空</span>
				stack<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">[</span>j<span class="token punctuation">]</span><span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p>积分规则&#xff1a;1行100分、2行300分、3行600分、4行1000分<br /> <img src="https://img-blog.csdnimg.cn/20210608003852720.gif#pic_center" alt="在这里插入图片描述" /></p> 
<h2><a id="_623"></a>显示下一个</h2> 
<p>这个其实不难&#xff1a;<br /> 1.创建好当前模型的时候&#xff0c;同时创建好下一个模型&#xff0c;并绘制出来&#xff1b;<br /> 2.当前模型触底累计后&#xff0c;把下一个模型设置为当前模型。<br /> 3.同时创建一个新模型做为下一个模型。</p> 
<pre><code class="prism language-java"><span class="token comment">//创建模型</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">createModel</span><span class="token punctuation">(</span><span class="token keyword">int</span> type<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>type<span class="token operator">&#61;&#61;</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span><span class="token comment">//游戏刚开始时</span>
			curModel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Model</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			nextModel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Model</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{<!-- --></span><span class="token comment">//游戏运行中</span>
			curModel <span class="token operator">&#61;</span> nextModel<span class="token punctuation">;</span>
			nextModel <span class="token operator">&#61;</span> <span class="token keyword">new</span> <span class="token class-name">Model</span><span class="token punctuation">(</span>x<span class="token punctuation">,</span>y<span class="token punctuation">,</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
</code></pre> 
<p><strong>在paint方法中绘制‘下一个’&#xff0c;在右边的下一个区域显示</strong></p> 
<pre><code class="prism language-java">		<span class="token comment">//下一个模型</span>
		<span class="token keyword">if</span><span class="token punctuation">(</span>nextModel<span class="token operator">!&#61;</span><span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
			<span class="token class-name">List</span> blocks <span class="token operator">&#61;</span> nextModel<span class="token punctuation">.</span><span class="token function">getBlocks</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token class-name">Block</span> block<span class="token operator">&#61;</span><span class="token keyword">null</span><span class="token punctuation">;</span>
			<span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">int</span> i <span class="token operator">&#61;</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> blocks<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> i<span class="token operator">&#43;&#43;</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
				block <span class="token operator">&#61;</span> <span class="token punctuation">(</span><span class="token class-name">Block</span><span class="token punctuation">)</span>blocks<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
				block<span class="token punctuation">.</span><span class="token function">drawNext</span><span class="token punctuation">(</span>g<span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
</code></pre> 
<h2><a id="_653"></a>加入自动向下线程&#xff0c;并启动</h2> 
<pre><code class="prism language-java"><span class="token comment">//游戏线程&#xff0c;用来自动下移</span>
<span class="token keyword">private</span> <span class="token keyword">class</span> <span class="token class-name">GameThread</span> <span class="token keyword">implements</span> <span class="token class-name">Runnable</span> <span class="token punctuation">{<!-- --></span>
	<span class="token annotation punctuation">&#64;Override</span>
	<span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">run</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
		<span class="token keyword">while</span> <span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
			<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token string">&#34;start&#34;</span><span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>gameFlag<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{<!-- --></span>
				curModel<span class="token punctuation">.</span><span class="token function">move</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
			<span class="token keyword">try</span> <span class="token punctuation">{<!-- --></span>
				<span class="token class-name">Thread</span><span class="token punctuation">.</span><span class="token function">sleep</span><span class="token punctuation">(</span><span class="token number">300</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span> <span class="token keyword">catch</span> <span class="token punctuation">(</span><span class="token class-name">InterruptedException</span> e<span class="token punctuation">)</span> <span class="token punctuation">{<!-- --></span>
				e<span class="token punctuation">.</span><span class="token function">printStackTrace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
			<span class="token punctuation">}</span>
		<span class="token punctuation">}</span>
	<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre> 
<p><img src="https://img-blog.csdnimg.cn/20210608004721337.gif#pic_center" alt="在这里插入图片描述" /></p> 
<h2><a id="_674"></a>最后</h2> 
<p><strong>加入积分、按键控制、游戏结束、重新开始等就完成了</strong></p> 
<p><strong>看到这里的大佬&#xff0c;动动发财的小手 <font color="red">点赞</font> &#43; <font color="red">回复</font> &#43; <font color="red">收藏</font>&#xff0c;能<font color="red">【 关注 </font>】一波就更好了。</strong></p> 
<p><strong><font color="red">代码获取方式</font>&#xff1a;<br /> 订阅我的专栏《<u><a href="https://blog.csdn.net/dkm123456/category_11085592.html">Java游戏大全</a></u>》后&#xff0c;可以<font color="red">联系博主</font>获取专栏里面的<font color="red">所有代码和文章</font>&#xff08;包括当前文章的代码&#xff09;&#xff0c;专栏的文章都是上过csdn热榜的&#xff0c;值得信赖&#xff01;专栏内目前有[9]篇实例&#xff0c;未来2个月内专栏会更新到15篇以上&#xff0c;一般一周一更&#xff0c;<u><a href="https://blog.csdn.net/dkm123456/category_11085592.html">了解一下我的专栏</a></u>。</strong></p> 
<h1><a id="font_colorred_683"></a><font color="red">更多精彩</font></h1> 
<p><a href="https://blog.csdn.net/dkm123456/article/details/117675468"><u>1. Java俄罗斯方块</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117431591"><u>2. 老Java程序员花2天写了个连连看</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117265359"><u>3. 老Java程序员花一天时间写了个飞机大战</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/118904917"><u>4. Java五子棋人机版</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117047116"><u>5. Java植物大战僵尸</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/118079900"><u>6. Java消消乐&#xff08;天天爱消除&#xff09;</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/117933331"><u>7. Java贪吃蛇小游戏</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/116637184"><u>8. Java扫雷小游戏</u></a><br /> <a href="https://blog.csdn.net/dkm123456/article/details/116609629"><u>9. Java坦克大战</u></a></p>
                </div>
                <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/markdown_views-d7a94ec6ab.css" rel="stylesheet">
                <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/style-49037e4d27.css" rel="stylesheet">
        </div>
        <div id="blogExtensionBox" style="width:400px;margin:auto;margin-top:12px" class="blog-extension-box"></div>
    </article>
</div>
<div class="more-toolbox-new" id="toolBarBox">
    <div class="left-toolbox">
        <div class="toolbox-left">
            <div class="profile-box"><a class="profile-href" target="_blank" href="https://blog.csdn.net/dkm123456"><img class="profile-img" src="https://profile.csdnimg.cn/6/E/C/3_dkm123456"><span class="profile-name">编程界明世隐</span></a></div>
            <div class="profile-attend">
                    <a class="tool-attend tool-bt-button tool-bt-attend" href="javascript:;" data-report-view='{"mod":"1592215036_002","spm":"1001.2101.3001.4232","extend1":"关注"}'>关注</a>
                <a class="tool-item-follow active-animation" style="display:none;">关注</a>
            </div>
        </div>
        <div class="toolbox-middle">
        <ul class="toolbox-list">
            <li class="tool-item tool-item-size tool-active is-like" id="is-like">
            <a class="tool-item-href">
                <img style="display:none;" id="is-like-imgactive-animation-like" class="animation-dom active-animation" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarThumbUpactive.png" alt="">
                <img class="isactive" style="display:none" id="is-like-imgactive" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newHeart1Active.png" alt="">
                <img class="isdefault" style="display:block" id="is-like-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newHeart1White.png" alt="">  
                <span id="spanCount" class="count ">
                        982
                </span>
            </a>
            <div class="tool-hover-tip"><span class="text space">点赞</span></div>
            </li>
            <li class="tool-item tool-item-size tool-active tool-item-comment">
            <a class="tool-item-href" href="#commentBox">
                <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newCommentWhite.png" alt="">
                <span class="count">
                    278
                </span>
            </a>
            <div class="tool-hover-tip"><span class="text space">评论</span></div>
            </li>
            <li class="tool-item tool-item-size tool-active is-collection ">
            <a class="tool-item-href" href="javascript:;" data-report-click='{"mod":"popu_824","spm":"1001.2101.3001.4130","ab":"new"}'>
                <img style="display:none" id="is-collection-img-collection" class="animation-dom active-animation" src="https://csdnimg.cn/release/blogv2/dist/pc/img/tobarCollectionActive.png" alt="">
                <img class="isdefault" id="is-collection-img" style="display:block" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newCollectWhite.png" alt="">
                <img class="isactive" id="is-collection-imgactive" style="display:none" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newCollectActive.png" alt="">
                <span class="count get-collection " id="get-collection">
                    2175
                </span>
            </a>
            <div class="tool-hover-tip"><span class="text space">收藏</span></div>
            </li>
            <li class="tool-item tool-active">
                <a class="" href="javascript:;">
                    <img class="company active" id="health-companies" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newHealthCompanies1Active.gif" alt="一键三连">
                </a>
                <div class="tool-hover-tip three-click"><span class="text">一键三连</span></div>
            </li>
            <li class="tool-item tool-item-bar">
            </li>
            <li class="tool-item tool-item-size tool-active tool-QRcode" id="tool-share">
                <a class="tool-item-href" href="javascript:;" data-report-click='{"mod":"1582594662_002","spm":"1001.2101.3001.4129","ab":"new"}'>
                    <img class="isdefault" src="https://csdnimg.cn/release/blogv2/dist/pc/img/newShareWhite.png" alt="">
                </a>
                <div class="QRcode" id="tool-QRcode">
                    <p class="title">
                    扫一扫，分享海报
                    </p>
                    <div id='shareCode'></div>
                </div>
            </li>
        </ul>
        </div>
        <div class="toolbox-right">
                <div class="tool-directory">
                    <a class="bt-columnlist-show"
                    data-id="11085592"
                    data-free="false"
                    data-subscribe="false"
                    data-title="Java游戏实例大全"
                    data-img="https://img-blog.csdnimg.cn/20210723110743428.png?x-oss-process=image/resize,m_fixed,h_224,w_224"
                    data-url="https://blog.csdn.net/dkm123456/category_11085592.html"
                    data-sum="12"
                    data-people="22"
                    data-price="79.90"
                    data-oldprice="99.00"
                    data-join="true"
                    data-studyvip="false"
                    data-studysubscribe="false"
                    data-report-view='{"spm":"1001.2101.3001.6334","extend1":"专栏目录"}'
                    data-report-click='{"spm":"1001.2101.3001.6334","extend1":"专栏目录"}'
                    >专栏目录</a>
                </div>
                <div class="tool-column">
                        <a class="tool-bt-button tool-bt-subscribe articleColumnBt" data-id="11085592" data-price="79.90" data-oldprice="99.00" href="javascript:;" data-report-view='{"mod":"1592215036_001","spm":"1001.2101.3001.4405","extend1":"订阅"}' data-report-click='{"mod":"1592215036_001","spm":"1001.2101.3001.4405","extend1":"订阅"}'>订阅专栏</a>
                </div>
        </div>
    </div>  
</div>
<script type=text/javascript crossorigin src="https://csdnimg.cn/release/phoenix/production/qrcode-7c90a92189.min.js"></script>
<script src="//g.csdnimg.cn/??sharewx/1.2.1/sharewx.js" type="text/javascript"></script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/user-login/3.0.1/user-login.js"></script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/collection-box/2.0.6/collection-box.js"></script>
                <div class="first-recommend-box recommend-box">
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/Javawithme/article/details/120325851"  data-report-view='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.587853\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","index":"1","style":"text_1","strategy":"32_587853_RCMD","dest":"https://blog.csdn.net/Javawithme/article/details/120325851"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/Javawithme/article/details/120325851" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.587853\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","index":"1","style":"text_1","strategy":"32_587853_RCMD","dest":"https://blog.csdn.net/Javawithme/article/details/120325851"}'  data-report-query='utm_medium=distribute.pc_relevant_t0.587853&depth_1-utm_source=distribute.pc_relevant_t0.587853'>
					<div class="left ellipsis-online ellipsis-online-1">谁说专科学历找不到<em>java</em>工作？自学<em>java</em>，第一份工作13k</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/Javawithme" target="_blank"><span class="blog-title">Javawithme的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">09-16</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					616
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/Javawithme/article/details/120325851" target="_blank"  data-report-click='{"ab":"new","mod":"popu_871","extra":"{\"utm_medium\":\"distribute.pc_relevant_t0.587853\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","index":"1","style":"text_1","strategy":"32_587853_RCMD","dest":"https://blog.csdn.net/Javawithme/article/details/120325851"}'  data-report-query='utm_medium=distribute.pc_relevant_t0.587853&depth_1-utm_source=distribute.pc_relevant_t0.587853'>
				<div class="desc ellipsis-online ellipsis-online-1">现在经常会在网上看到说<em>Java</em>饱和了，专科找不到工作，不是科班找不到工作之类的话。作为已经成功转行的我，现在明白了一个道理：那些顺利转行成功的，不会去网上说自己转行有多么容易；但是那些转行不成功的，就会到网上宣传行业饱和了，专科找不到工作。现在学的人确实越来越多了，但是学的好，达到公司招聘标准的却没有几个。这是一个技术行业，最终能不能找到工作，找到什么样的工作主要还是看技术学的怎么样，学历，专业对口只是一个人的加分项，如果不是进大公司，只是选择一些中小公司的话，公司主要看重的还是这个人的实际</div>
			</a>
		</div>
	</div>
</div>
                </div>
            <div class="second-recommend-box recommend-box">
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/117536930"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-1.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"1","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117536930"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/117536930" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-1.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"1","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117536930"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em>Web图书管理系统，<em>老</em><em>程序员</em><em>花</em>一天一夜回忆学生时代！</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-04</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					2万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/117536930" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-1.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"1","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117536930"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">系统界面图一张
引言：
前几天群里的小伙伴说想搞个图书管理系统，也有人说谁还搞那个东西，都过时了的东西，我就想说一句：甭管过不过时，对于很多同学和小白来说，拿来学习一波很合适、没毛病，于是我连夜写了这个小管理系统，我就玩！
系统功能

角色介绍
1.超级管理员
权限：超级管理员是权限最大的角色，有系统所有的权限。

2.系统管理员
权限：教师/学生管理、分类管理、图书管理、借阅信息管理、密码管理、登陆模块。

3.教师 / 学生
权限：权限最小的角色，仅有修改密码、注册登陆登出系统、查询图书信息、查询自己的</div>
			</a>
		</div>
	</div>
</div>
            </div>
<a id="commentBox" name="commentBox"></a>
<div class="comment-box">
	<div class="comment-edit-box d-flex">
		<a id="commentsedit"></a>
		<div class="user-img">
			<a href="javascript:void(0);" >
				<img class="show_loginbox" src="https://g.csdnimg.cn/static/user-img/anonymous-User-img.png">
			</a>
		</div>
		<form id="commentform">
			<img class="comment-sofa-flag" src="https://csdnimg.cn/release/blogv2/dist/pc/img/commentFlag@2x.png">
      <textarea class="comment-content" name="comment_content" id="comment_content" placeholder="优质评论可以帮助作者获得更高权重" maxlength="1000"></textarea>
			<div class="comment-emoticon"><img class="comment-emoticon-img" data-url="https://csdnimg.cn/release/blogv2/dist/pc/img/" src="https://csdnimg.cn/release/blogv2/dist/pc/img/emoticon.png" alt="表情包"></div> 
      <span class="comment-emoticon-tip">插入表情</span>
      <div class="comment-emoticon-box">
        <div class="comment-emoticon-img-box"></div>
			</div>
      <div class="opt-box">
				<div id="ubbtools" class="add_code">
					<a href="#insertcode" code="code" target="_self"><i class="icon iconfont icon-daima"></i></a>
				</div>
				<input type="hidden" id="comment_replyId" name="comment_replyId">
				<input type="hidden" id="article_id" name="article_id" value="117675468">
				<input type="hidden" id="comment_userId" name="comment_userId" value="">
				<input type="hidden" id="commentId" name="commentId" value="">
				<div class="dropdown" id="myDrap">
					<a class="dropdown-face d-flex align-items-center" data-toggle="dropdown" role="button"
						aria-haspopup="true" aria-expanded="false">
						<div class="txt-selected text-truncate">添加代码片</div>
						<svg class="icon d-block" width="200px" height="100.00px" viewBox="0 0 2048 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path  d="M597.33333292 298.666667h853.333334L1023.99999992 725.333333 597.33333292 298.666667z"  /></svg>
					</a>
					<ul class="dropdown-menu" id="commentCode" aria-labelledby="drop4">
						<li><a data-code="html">HTML/XML</a></li>
						<li><a data-code="objc">objective-c</a></li>
						<li><a data-code="ruby">Ruby</a></li>
						<li><a data-code="php">PHP</a></li>
						<li><a data-code="csharp">C</a></li>
						<li><a data-code="cpp">C++</a></li>
						<li><a data-code="javascript">JavaScript</a></li>
						<li><a data-code="python">Python</a></li>
						<li><a data-code="java">Java</a></li>
						<li><a data-code="css">CSS</a></li>
						<li><a data-code="sql">SQL</a></li>
						<li><a data-code="plain">其它</a></li>
					</ul>
				</div>
				<div class="right-box" id="rightBox" data-type="2">
							<span id="tip_comment" class="tip">还能输入<em>1000</em>个字符</span>
							<a data-report-click='{"mod":"1582594662_003","spm":"1001.2101.3001.4227","ab":"new"}'><input type="submit"
									class="btn btn-sm btn-comment" value="发表评论"></a>
				</div>
			</div>
		</form>
		<input type="button" class="bt-comment-show" value="评论">
	</div>
	<div class="comment-list-container">
		<a id="comments"></a>
		<div class="comment-list-box">
		</div>
		<div id="commentPage" class="pagination-box d-none"></div>
		<div class="opt-box text-center">
			<div class="btn btn-sm btn-link-blue" id="btnMoreComment"></div>
		</div>
	</div>
</div>            <div class="recommend-box insert-baidu-box">
                <div class="recommend-item-box clearfix" style="display:none"></div>
<div class="recommend-item-box type_download clearfix" data-url="http://download.csdn.net/download/xiaotong0202/846249"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-download-2~default~CTRLIST~default-2.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"2","strategy":"2~default~CTRLIST~default","dest":"http://download.csdn.net/download/xiaotong0202/846249"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="http://download.csdn.net/download/xiaotong0202/846249" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-download-2~default~CTRLIST~default-2.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"2","strategy":"2~default~CTRLIST~default","dest":"http://download.csdn.net/download/xiaotong0202/846249"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-download-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-download-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">一个<em>老</em><em>程序员</em>的心里话！！</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info display-flex">
					<span class="info-block">12-07</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="http://download.csdn.net/download/xiaotong0202/846249" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-download-2~default~CTRLIST~default-2.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"2","strategy":"2~default~CTRLIST~default","dest":"http://download.csdn.net/download/xiaotong0202/846249"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-download-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-download-2%7Edefault%7ECTRLIST%7Edefault-2.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">编程生涯  实践第一   永无止境的软件之路
吐血经验,给我们指导</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/118531061"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-3.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"3","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/118531061"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/118531061" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-3.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"3","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/118531061"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-3.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-3.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">从零学<em>Java</em>（6）之字面量和常量，我家AD想要第一滴血</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">07-09</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1585
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/118531061" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-3.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"3","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/118531061"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-3.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-3.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">作者简介

作者名：编程界明世隐
简介：CSDN博客专家，从事软件开发多年，精通<em>Java</em>、<em>Java</em>Script，博主也是从零开始一步步把学习成长、深知学习和积累的重要性，喜欢跟广大ADC一起打野升级，欢迎您关注，期待与您一起学习、成长、起飞！

目录
从零学<em>Java</em>（6）之字面量和常量
从零学<em>Java</em>（5）之关键字和保留字
从零学<em>Java</em>（4）之编程规范
从零学<em>Java</em>（3）之第一个实例HelloWorld
从零学<em>Java</em>（2）之搭建开发环境
从零学<em>Java</em>（1）之面向对象
引言

♀ 小AD：
♂ 明世隐</div>
			</a>
		</div>
	</div>
</div>
		<dl id="recommend-item-box-tow" class="recommend-item-box type_blog clearfix">
			
		</dl>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/117431591"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-4.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"4","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117431591"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/117431591" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-4.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"4","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117431591"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>老</em><em>Java</em><em>程序员</em><em>花</em>2天写了个连连看，我竟连不过我女儿，我了个去！</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-01</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					4万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/117431591" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-4.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"4","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/dkm123456/article/details/117431591"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-4.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">引言：
最近做小<em>游戏</em>有点上瘾，这一不小心翻到了个连连看，二话不说找到素材，就撸了起来，期间在我加入背景音乐的时候，被女儿听到了，她多次到我身边跟我说要给她玩这个<em>游戏</em>，不然她就捣乱，不让我写代码，讲实话我写代码正投入的时候，如果换做我<em>老</em>婆，我肯定一把推开，但是我女儿，只好展现我作为父亲慈祥的一面，我跟她说做完给你玩，如果连的过爸爸，就给你玩多几盘，但是现在不能，等我做完我们来比赛，她这才答应不捣乱，打断我写代码的思路，我要抓狂的，不知各位亲在你全身心投入写代码的时候，女票、媳妇捣乱你会怎么做呢？欢迎就此话题留</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/yeluoxiang/article/details/102661077"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-5.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"5","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/yeluoxiang/article/details/102661077"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/yeluoxiang/article/details/102661077" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-5.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"5","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/yeluoxiang/article/details/102661077"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-5.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-5.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">【干货】我是怎么走进阿里做<em>程序员</em>的？</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/yeluoxiang" target="_blank"><span class="blog-title">yeluoxiang的专栏</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">07-22</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					882
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/yeluoxiang/article/details/102661077" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-5.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"5","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/yeluoxiang/article/details/102661077"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-5.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-5.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">一个非科班专业的大学生，没有上过任何编程相关培训，是如何一步一步走进阿里做<em>程序员</em>的？本文记录了我的大学时期的心路历程，有迷茫与思考，有徘徊和坚定，但是从来没有放弃与后悔。...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/117265359"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-6.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"6","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/117265359"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/117265359" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-6.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"6","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/117265359"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-6.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-6.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>老</em><em>Java</em><em>程序员</em><em>花</em>一天时间写了个飞机大战，很舒服！</div>
					<div class="tag">热门推荐</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">05-26</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					5万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/117265359" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-6.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"6","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/117265359"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-6.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-6.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">引言：
前两天我发现CSDN上有两篇飞机大战的文章异常火爆，各种指标都很高（阅读、点赞、评论、收藏等），但都是python写的，竟然不是我大<em>Java</em>，说实话作为<em>老</em><em>java</em>选手，我心里是有那么一些失落的，难道我大<em>java</em>打飞机不行？就算大<em>java</em>打飞机不行，那我用单身30年的打飞机手速，我肯定行（反正我的代码我做主，就是玩！），于是我决定一展伸手，用<em>java</em>写了一个飞机大战。我就问你们我打飞机行不行，我媳妇都说行，你们呢？欢迎我亲爱的大<em>Java</em>选手们 点赞+评论+收藏！给我冲、冲、冲。。。
/*
 * <em>游戏</em>窗</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/119763412"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-7.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"7","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119763412"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/119763412" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-7.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"7","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119763412"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-7.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-7.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em>拼图<em>游戏</em>，<em>老</em><em>程序员</em><em>花</em>两天搞定，你呢？</div>
					<div class="tag">最新发布</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-18</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					826
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/119763412" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-7.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"7","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119763412"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-7.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-7.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">作者简介

作者名：编程界明世隐
简介：CSDN博客专家，从事软件开发多年，精通<em>Java</em>、<em>Java</em>Script，博主也是从零开始一步步把学习成长、深知学习和积累的重要性，喜欢跟广大ADC一起打野升级，欢迎您关注，期待与您一起学习、成长、起飞！

系列目录
1. <em>Java</em><em>俄罗斯方块</em>
2. <em>Java</em>五子棋小<em>游戏</em>
3. <em>老</em><em>Java</em><em>程序员</em><em>花</em>一天时间写了个飞机大战
4. <em>Java</em>植物大战僵尸
5. <em>老</em><em>Java</em><em>程序员</em><em>花</em>2天写了个连连看
6. <em>Java</em>消消乐（天天爱消除）
7. <em>Java</em>贪吃蛇小<em>游戏</em>
8. <em>Java</em>扫雷小</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/linjpg/article/details/80807685"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-8.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"8","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/linjpg/article/details/80807685"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/linjpg/article/details/80807685" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-8.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"8","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/linjpg/article/details/80807685"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-8.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-8.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>java</em>中新生代和<em>老</em><em>年代</em></div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/linjpg" target="_blank"><span class="blog-title">大鹏小站的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-25</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					4573
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/linjpg/article/details/80807685" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-8.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"8","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/linjpg/article/details/80807685"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-8.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-8.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">1.为什么会有年轻代我们先来屡屡，为什么需要把堆分代？不分代不能完成他所做的事情么？其实不分代完全可以，分代的唯一理由就是优化GC性能。你先想想，如果没有分代，那我们所有的对象都在一块，GC的时候我们要找到哪些对象没用，这样就会对堆的所有区域进行扫描。而我们的很多对象都是朝生夕死的，如果分代的话，我们把新创建的对象放到某一地方，当GC的时候先把这块存&ldquo;朝生夕死&rdquo;对象的区域进行回收，这样就会腾出很大...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/weixin_34248258/article/details/85655195"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-9.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"9","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34248258/article/details/85655195"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/weixin_34248258/article/details/85655195" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-9.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"9","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34248258/article/details/85655195"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-9.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-9.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em> GC、新生代、<em>老</em><em>年代</em></div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/weixin_34248258" target="_blank"><span class="blog-title">weixin_34248258的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">09-07</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					152
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/weixin_34248258/article/details/85655195" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-9.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"9","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34248258/article/details/85655195"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-9.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-9.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">堆内存&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<em>Java</em> 中的堆是 JVM 所管理的最大的一块内存空间，主要用于存放各种类的实例对象。在 <em>Java</em> 中，堆被划分成两个不同的区域：新生代 ( Young )、<em>老</em><em>年代</em> ( Old )。新生代 ( Young ) 又被划分为三个区...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/weixin_34409357/article/details/93900124"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-10.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"10","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34409357/article/details/93900124"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/weixin_34409357/article/details/93900124" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-10.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"10","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34409357/article/details/93900124"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-10.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-10.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em>垃圾回收之<em>老</em><em>年代</em>垃圾收集器</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/weixin_34409357" target="_blank"><span class="blog-title">weixin_34409357的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">04-06</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					718
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/weixin_34409357/article/details/93900124" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-10.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"10","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_34409357/article/details/93900124"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-10.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-10.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">1、Serial Old 收集器（-XX: +UseSerialOldGC, 标记-整理算法）
　　1.1 单线程收集，进行垃圾收集时，必须暂停所有工作线程
　　1.2 简单高效，Client模式下默认的<em>老</em><em>年代</em>收集器


2、Parallel Od收集器(-XX: +UseParallelOldGC ，标记-整理)
　　2.1 JDK6 之后才有这个收集器，多线程，吞吐量优先，如果...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/xuxue_liu/article/details/6474911"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-11.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"11","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuxue_liu/article/details/6474911"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/xuxue_liu/article/details/6474911" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-11.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"11","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuxue_liu/article/details/6474911"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-11.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-11.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>周末</em>了</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/xuxue_liu" target="_blank"><span class="blog-title">xuxue_liu的专栏</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">09-11</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					418
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/xuxue_liu/article/details/6474911" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-11.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"11","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuxue_liu/article/details/6474911"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-11.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-11.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1"></div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/qq_41383905/article/details/88937834"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-12.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"12","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/qq_41383905/article/details/88937834"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/qq_41383905/article/details/88937834" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-12.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"12","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/qq_41383905/article/details/88937834"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-12.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-12.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>java</em>新生代和<em>老</em><em>年代</em></div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/qq_41383905" target="_blank"><span class="blog-title">为猫的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">03-31</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1026
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/qq_41383905/article/details/88937834" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-12.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"12","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/qq_41383905/article/details/88937834"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-12.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-12.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">堆被划分成两个不同的区域：新生代 ( Young )、<em>老</em><em>年代</em> ( Old )。新生代 ( Young ) 又被划分为三个区域：Eden、From Survivor、To Survivor。

这样划分的目的是为了使 JVM 能够更好的管理堆内存中的对象，包括内存的分配以及回收。

堆的内存模型大致为：



新生代 ( Young ) 与<em>老</em><em>年代</em> ( Old ) 的比例的值为1:2( 该值可以通...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/xuanshilee/article/details/91043683"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-13.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"13","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuanshilee/article/details/91043683"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/xuanshilee/article/details/91043683" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-13.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"13","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuanshilee/article/details/91043683"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-13.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-13.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">一个大概是被称作为&ldquo;废物&rdquo;的<em>程序员</em>的回顾，从18岁到30岁</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/xuanshilee" target="_blank"><span class="blog-title">xuanshilee的专栏</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-09</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					2370
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/xuanshilee/article/details/91043683" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~CTRLIST~default-13.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"13","strategy":"2~default~CTRLIST~default","dest":"https://blog.csdn.net/xuanshilee/article/details/91043683"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-13.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-13.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">许久许久许久都没有碰过博客了，平时也几乎不会浏览技术论坛，CSDN对我来说作用就是下载+帮同事下载，昨晚（或者可以说是今天凌晨）上CSDN手贱点开了界面里一条关于<em>程序员</em>的文章链接，然后文章下又有更多的文章链接，于是...看了一晚上。往日里开开心心加着班，一直保持我coding我快乐的心态工作了这么些年来的我，惊讶（大概吧）地发现，原来我可能就是大部分评论区里描述的那种&ldquo;不去学习新知...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/118079900"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-14.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"14","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/118079900"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/118079900" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-14.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"14","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/118079900"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-14.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-14.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>老</em><em>Java</em><em>程序员</em><em>花</em>两天做了个消消乐（天天爱消除）</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-22</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					2万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/118079900" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-14.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"14","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/118079900"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-14.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-14.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">引言：
一直就想做一个消消乐，这次正好找到了素材，就自己琢磨写了一个，我觉得这个<em>游戏</em>难点就在消除后的下落。
效果图

实现思路
1.绘制窗口、按钮、边框等
2.实现Card类，用来代表每一个小图形。
3.创建二维数组9行8列
最后
加入积分、<em>游戏</em>结束、重新开始、音效等等就完成了
看到这里的大佬，动动发财的小手 点赞 + 回复 + 收藏，能【 关注 】一波就更好了。
想要代码的 加微信 或 私聊 我！
为了帮助更多小白从零进阶 <em>Java</em> 工程师，从CSDN官方那边搞来了一套 《<em>Java</em> 工程师学习成长知识图谱</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/jinjianghai/article/details/93894827"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-15.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"15","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/jinjianghai/article/details/93894827"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/jinjianghai/article/details/93894827" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-15.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"15","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/jinjianghai/article/details/93894827"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-15.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-15.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em> 内存 新生代<em>老</em><em>年代</em>占比</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/jinjianghai" target="_blank"><span class="blog-title">靳江海</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">06-27</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1860
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/jinjianghai/article/details/93894827" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-15.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"15","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/jinjianghai/article/details/93894827"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-15.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-15.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">[0.287s][info   ][gc,heap,exit ] Heap
[0.287s][info   ][gc,heap,exit ]  def new generation   total 6144K, used 5907K [0x00000007bec00000, 0x00000007bf2a0000, 0x00000007bf2a0000)
[0.287s][info   ][gc,h...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/dkm123456/article/details/119465016"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-16.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"16","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119465016"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/dkm123456/article/details/119465016" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-16.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"16","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119465016"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-16.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-16.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em>迷宫小<em>游戏</em>，<em>老</em><em>程序员</em><em>花</em>一天时间完成，你可以吗？</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/dkm123456" target="_blank"><span class="blog-title">编程界明世隐的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-09</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1万+
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/dkm123456/article/details/119465016" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-16.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"16","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/dkm123456/article/details/119465016"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-16.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-16.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">作者简介

作者名：编程界明世隐
简介：CSDN博客专家，从事软件开发多年，精通<em>Java</em>、<em>Java</em>Script，博主也是从零开始一步步把学习成长、深知学习和积累的重要性，喜欢跟广大ADC一起打野升级，欢迎您关注，期待与您一起学习、成长、起飞！

系列目录
1. <em>Java</em><em>俄罗斯方块</em>
2. <em>Java</em>五子棋小<em>游戏</em>
3. <em>老</em><em>Java</em><em>程序员</em><em>花</em>一天时间写了个飞机大战
4. <em>Java</em>植物大战僵尸
5. <em>老</em><em>Java</em><em>程序员</em><em>花</em>2天写了个连连看
6. <em>Java</em>消消乐（天天爱消除）
7. <em>Java</em>贪吃蛇小<em>游戏</em>
8. <em>Java</em>扫雷小</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/liyu121/article/details/90105990"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-17.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"17","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/liyu121/article/details/90105990"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/liyu121/article/details/90105990" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-17.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"17","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/liyu121/article/details/90105990"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-17.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-17.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">对象如何进入<em>老</em><em>年代</em></div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/liyu121" target="_blank"><span class="blog-title">liyu121的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">05-11</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					2653
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/liyu121/article/details/90105990" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-17.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"17","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/liyu121/article/details/90105990"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-17.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-17.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1">问题：一般而言，对象首次创建会被放置在新生代的eden区，如果没有gc的介入就不会离开eden区，那么eden区的对象怎么进入<em>老</em><em>年代</em>呢？

主要有下面三种方式：大对象，长期存活的对象，动态对象年龄判定

1：大对象直接进入<em>老</em><em>年代</em>。比如很长的字符串，或者很大的数组等，参数-XX:PretenureSizeThreshold=3145728设置，超过这个参数设置的值就直接进入<em>老</em><em>年代</em>

2：长期存活的对...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/rogerxue12345/article/details/107860823"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-18.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"18","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/rogerxue12345/article/details/107860823"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/rogerxue12345/article/details/107860823" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-18.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"18","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/rogerxue12345/article/details/107860823"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-18.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-18.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">JVM<em>老</em><em>年代</em>垃圾回收Full GC</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/rogerxue12345" target="_blank"><span class="blog-title">rogerxue12345的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-07</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1333
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/rogerxue12345/article/details/107860823" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-18.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"18","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/rogerxue12345/article/details/107860823"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-18.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-18.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>老</em><em>年代</em>GC：FullGC 是<em>老</em><em>年代</em>的GC，在新生代如果说存在的对象或者说新创建 出来的对象由于某些原因需要移动到<em>老</em><em>年代</em>中，但是<em>老</em><em>年代</em>中压根就没有这么大的内存空间去容纳这个对象， 那么就会引发一次FullGC，如果在执行完FullGC之后，还是没有办法给这些对象分配内存，那么凉了，该抛出异常了，异常类型就是OutOfMemoryError。

而FullGC使用的是和MinorGC不一样的算法，它使用的是标记清除算法，听名字，挺好理解的，来波图示解析一波。深入了解JVM一书中的图示是这个样子的，



看名.</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/gyxinguan/article/details/98665943"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-19.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"19","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/gyxinguan/article/details/98665943"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/gyxinguan/article/details/98665943" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-19.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"19","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/gyxinguan/article/details/98665943"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-19.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-19.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1">JVM 新生代<em>老</em><em>年代</em>与GC</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/gyxinguan" target="_blank"><span class="blog-title">Adolph的专栏</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">08-06</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					2531
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/gyxinguan/article/details/98665943" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-19.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"19","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/gyxinguan/article/details/98665943"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-19.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-19.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>Java</em>堆可以分为新生代和<em>老</em><em>年代</em>两个区，其中新生代又可以分为一个Eden区和两个Survivor区，两个Survivor区分别被命名为From和To以示区分，新生代和<em>老</em><em>年代</em>的比例为1：2，它们共同组成堆的内存区，所以新生代占堆的1/3，<em>老</em><em>年代</em>占2/3，但这个比例可以修改，下面分别来介绍一下新生代和<em>老</em><em>年代</em>。

1、【新生代】

新生代分为三个区域，一个Eden区和两个Survivor区，它们之间的比...</div>
			</a>
		</div>
	</div>
</div>
<div class="recommend-item-box type_blog clearfix" data-url="https://blog.csdn.net/weixin_38569499/article/details/103735948"  data-report-view='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-20.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"20","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_38569499/article/details/103735948"}'>
	<div class="content-box">
		<div class="content-blog display-flex">
			<div class="title-box">
				<a href="https://blog.csdn.net/weixin_38569499/article/details/103735948" class="tit" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-20.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"20","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_38569499/article/details/103735948"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-20.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-20.no_search_link'>
					<div class="left ellipsis-online ellipsis-online-1"><em>Java</em> GC新生代晋升<em>老</em><em>年代</em>的情况</div>
				</a>
			</div>
			<div class="info-box display-flex">
				<div class="info">
					<a href="https://blog.csdn.net/weixin_38569499" target="_blank"><span class="blog-title">weixin_38569499的博客</span></a>
				</div>
				<div class="info display-flex">
					<span class="info-block time">12-27</span>
					<span class="info-block read"><img class="read-img" src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					1714
					</span>
				</div>
			</div>
		</div>
		<div class="desc-box">
			<a href="https://blog.csdn.net/weixin_38569499/article/details/103735948" target="_blank"  data-report-click='{"ab":"new","mod":"popu_387","extra":"{\"utm_medium\":\"distribute.pc_relevant.none-task-blog-2~default~essearch~vector-20.no_search_link\",\"dist_request_id\":\"1631862806349_94908\"}","dist_request_id":"1631862806349_94908","ab_strategy":"ctrlist","index":"20","strategy":"2~default~essearch~vector","dest":"https://blog.csdn.net/weixin_38569499/article/details/103735948"}'  data-report-query='utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-20.no_search_link&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7Eessearch%7Evector-20.no_search_link'>
				<div class="desc ellipsis-online ellipsis-online-1"><em>Java</em>中对象一般在新生代中进行创建，但是在一定的机制中会触发晋升<em>老</em><em>年代</em>的机制。相关机制包括：

1、分配担保机制

  Eden区满时，进行Minor GC，当Eden和一个Survivor区中依然存活的对象无法放入到Survivor中，则通过分配担保机制提前转移到<em>老</em><em>年代</em>中。

2、对象过大

  若对象体积太大，新生代无法容纳这个对象，就会绕过新生代, 直接在<em>老</em><em>年代</em>分配, 此...</div>
			</a>
		</div>
	</div>
</div>
            </div>
            <div class="template-box">
                <span>©️2020 CSDN</span>
                <span>皮肤主题: 撸撸猫</span>
                <span> 设计师:马嘣嘣</span>
                <span>
                    <a href="https://blog.csdn.net/" class="back-home c-blue c-blue-hover c-blue-focus">返回首页</a>
                </span>
            </div>
<div class="blog-footer-bottom" style="margin-top:10px;"></div>
<script src="https://g.csdnimg.cn/common/csdn-footer/csdn-footer.js" data-isfootertrack="false" type="text/javascript"></script>
<script type="text/javascript">
    window.csdn.csdnFooter.options = {
        el: '.blog-footer-bottom',
        type: 2
    }
</script>        </main>
<aside class="blog_container_aside">
	<div id="asideProfile" class="aside-box">
    <div class="profile-intro d-flex">
        <div class="avatar-box d-flex justify-content-center flex-column">
            <a href="https://blog.csdn.net/dkm123456" data-report-click='{"mod":"popu_379","spm":"1001.2101.3001.4121","dest":"https://blog.csdn.net/dkm123456","ab":"new"}'>
                <img src="https://profile.csdnimg.cn/6/E/C/3_dkm123456" class="avatar_pic">
            </a>
        </div>
        <div class="user-info d-flex flex-column profile-intro-name-box">
            <div class="profile-intro-name-boxTop">
                <a href="https://blog.csdn.net/dkm123456" class="" id="uid" title="编程界明世隐" data-report-click='{"mod":"popu_379","spm":"1001.2101.3001.4122","dest":"https://blog.csdn.net/dkm123456","ab":"new"}'>
                    <span class="name " username="dkm123456">编程界明世隐</span>
                </a>
                <span>
                </span>
                <span class="flag expert-blog">
                <img class="identity" src="https://csdnimg.cn/release/blogv2/dist/mobile/img/expertNew.png" alt="">
                <span class="bubble">CSDN认证博客专家</span>
                </span>
                <span class="flag company-blog">
                <span class="bubble">CSDN认证企业博客</span>
                </span>
            </div>
            <div class="profile-intro-name-boxFooter">
                <span class="personal-home-page personal-home-years">码龄14年</span>
                    <span class="personal-home-page">
                    <a class="personal-home-certification" href="https://i.csdn.net/#/uc/profile?utm_source=14998968" target="_blank" title="Java领域优质创作者">
                    <img src="https://img-home.csdnimg.cn/images/20210412060958.png" alt="">
                    Java领域优质创作者
                    </a>
                    </span>
            </div>
        </div>
    </div>
    <div class="data-info d-flex item-tiling">
        <dl class="text-center" title="258">
            <a href="https://blog.csdn.net/dkm123456" data-report-click='{"mod":"1598321000_001","spm":"1001.2101.3001.4310"}' data-report-query="t=1">  
                <dt><span class="count">258</span></dt>
                <dd class="font">原创</dd>
            </a>
        </dl>
        <dl class="text-center" data-report-click='{"mod":"1598321000_002","spm":"1001.2101.3001.4311"}' title="42">
            <a href="https://blog.csdn.net/rank/list/weekly" target="_blank">
                <dt><span class="count">42</span></dt>
                <dd class="font">周排名</dd>
            </a>
        </dl>
        <dl class="text-center" title="310">
            <a href="https://blog.csdn.net/rank/list/total" data-report-click='{"mod":"1598321000_003","spm":"1001.2101.3001.4312"}' target="_blank">
                <dt><span class="count">310</span></dt>
                <dd class="font">总排名</dd>
            </a>
        </dl>
        <dl class="text-center" style="min-width:58px" title="771180">  
            <dt><span class="count">77万+</span></dt>
            <dd>访问</dd>
        </dl>
        <dl class="text-center" title="7级,点击查看等级说明">
            <dt><a href="https://blog.csdn.net/blogdevteam/article/details/103478461" target="_blank">
                <img class="level" src="https://csdnimg.cn/identity/blog7.png">
            </a>
            </dt>
            <dd>等级</dd>
        </dl>
    </div>
    <div class="item-rank"></div>
    <div class="data-info d-flex item-tiling">
        <dl class="text-center" title="23055">
            <dt><span class="count">2万+</span></dt>
            <dd>积分</dd>
        </dl>
         <dl class="text-center" id="fanBox" title="50831">
            <dt><span class="count" id="fan">5万+</span></dt>
            <dd>粉丝</dd>
        </dl>
        <dl class="text-center" title="9611">
            <dt><span class="count">9611</span></dt>
            <dd>获赞</dd>
        </dl>
        <dl class="text-center" title="5605">
            <dt><span class="count">5605</span></dt>
            <dd>评论</dd>
        </dl>
        <dl class="text-center" title="17853">
            <dt><span class="count">1万+</span></dt>
            <dd>收藏</dd>
        </dl>
    </div>
    <div class="aside-box-footer" data-report-view='{"spm":"3001.4296"}'>
        <div class="badge-box d-flex">
            <div class="badge d-flex">
                <div class="icon-badge" title="新人勋章">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/blinknewcomer@240.png" alt="新人勋章">
                    </div>
                </div>
                <div class="icon-badge" title="签到达人">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/qiandao50@240.png" alt="签到达人">
                    </div>
                </div>
                <div class="icon-badge" title="阅读者勋章Lv5">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/yuedu180@240.png" alt="阅读者勋章Lv5">
                    </div>
                </div>
                <div class="icon-badge" title="新秀勋章">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/xinxiu@240.png" alt="新秀勋章">
                    </div>
                </div>
                <div class="icon-badge" title="持之以恒">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/chizhiyiheng@240.png" alt="持之以恒">
                    </div>
                </div>
                <div class="icon-badge" title="勤写标兵Lv4">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/qixiebiaobing4@240.png" alt="勤写标兵Lv4">
                    </div>
                </div>
                <div class="icon-badge" title="分享宗师">
                    <div class="mouse-box">
                        <img class="medal-img" data-report-click='{"spm":"3001.4296"}' src="https://csdnimg.cn/medal/fenxiangzongshi@240.png" alt="分享宗师">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="profile-intro-name-boxOpration">
        <div class="opt-letter-watch-box">
        <a class="bt-button personal-letter" href="https://im.csdn.net/chat/dkm123456" target="_blank" rel="noopener">私信</a>
        </div>
        <div class="opt-letter-watch-box"> 
            <a class="personal-watch bt-button" id="btnAttent" >关注</a>  
        </div>
    </div>
</div>
<div id="asideSearchArticle" class="aside-box">
	<div class="aside-content search-comter">
    <div class="aside-search aside-search-blog">         
        <input type="text" class="input-serch-blog" name="" autocomplete="off" value="" id="search-blog-words" placeholder="搜博主文章">
        <a class="btn-search-blog">
                    <img src="//csdnimg.cn/cdn/content-toolbar/csdn-sou.png?v=1587021042">
        </a>
    </div>
    </div>
</div>

<div id="asideCustom" class="aside-box custom-box">
    <h3 class="aside-title">博主信息</h3>
    <div class="aside-content clearfix">
        <b>扫码关注微信公众号&#xff0c;领取海量资料&#xff01; <img alt="" src="https://img-blog.csdnimg.cn/a6598edd8f024d7aa889e16cb79fc2ce.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" /> 个人微信号&#xff1a;<font color="red">qq283582761</font>&#xff0c;我有学习交流群&#xff0c;加我V&#xff0c;我邀请你进群&#xff0c;群内有各种技术大佬、在校学生、未来技术大佬等&#xff01; <img alt="" src="https://img-blog.csdnimg.cn/35fc9e248f6940268202107cac99878a.png?x-oss-process&#61;image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RrbTEyMzQ1Ng&#61;&#61;,size_16,color_FFFFFF,t_70" />
 <div style="text-align:center;"> 
  <b> <b>博主友链</b> 
   <hr /><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/weixin_43591980">兴趣使然的草帽路飞 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/weixin_39709134">Java李阳勇 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/blue_698">David凉宸 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://xiaoxuzhu.blog.csdn.net/">小虚竹 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/weixin_44940405">程序猿是小贺 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://linjc.blog.csdn.net/">小丞同学 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/WhereIsHeroFrom">英雄哪里出来 <br />
     </a><a style="color:#FF6600;font-size:16px;" href="https://blog.csdn.net/guorui_java/">哪吒 <br />
     </a></b>
 </div></b>
    </div>
</div>

<div id="asideHotArticle" class="aside-box">
	<h3 class="aside-title">热门文章</h3>
	<div class="aside-content">
		<ul class="hotArticle-list">
			<li>
				<a href="https://blog.csdn.net/dkm123456/article/details/117675468" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://blog.csdn.net/dkm123456/article/details/117675468","ab":"new"}'>
				Java俄罗斯方块，老程序员花了一个周末，连接中学年代！
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">126482</span>
                </a>
			</li>
			<li>
				<a href="https://blog.csdn.net/dkm123456/article/details/117265359" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://blog.csdn.net/dkm123456/article/details/117265359","ab":"new"}'>
				老Java程序员花一天时间写了个飞机大战，很舒服！
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">53193</span>
                </a>
			</li>
			<li>
				<a href="https://blog.csdn.net/dkm123456/article/details/117431591" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://blog.csdn.net/dkm123456/article/details/117431591","ab":"new"}'>
				老Java程序员花2天写了个连连看，我竟连不过我女儿，我了个去！
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">46307</span>
                </a>
			</li>
			<li>
				<a href="https://blog.csdn.net/dkm123456/article/details/118904917" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://blog.csdn.net/dkm123456/article/details/118904917","ab":"new"}'>
				Java五子棋（人机版），昨天买的棋子今天就用不上了
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">36834</span>
                </a>
			</li>
			<li>
				<a href="https://blog.csdn.net/dkm123456/article/details/116272578" target="_blank"  data-report-click='{"mod":"popu_541","spm":"1001.2101.3001.4139","dest":"https://blog.csdn.net/dkm123456/article/details/116272578","ab":"new"}'>
				java学生宿舍管理系统，来了就点个赞再走呗，即将毕业的兄弟有福了！
					<img src="https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png" alt="">
					<span class="read">33908</span>
                </a>
			</li>
		</ul>
	</div>
</div>
<div id="asideCategory" class="aside-box flexible-box">
    <h3 class="aside-title">分类专栏</h3>
    <div class="aside-content">
        <ul>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085592.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085592.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210723110743428.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Java游戏实例大全</span>
                        <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                    </span>
                    <span class="count float-right">12篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085433.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085433.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210524191943772.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">java web项目实战</span>
                        <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                    </span>
                    <span class="count float-right">6篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085472.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085472.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210524185108211.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">javascript精彩实例</span>
                        <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                    </span>
                    <span class="count float-right">23篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10722701.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10722701.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210704165918193.jpeg?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">java项目实战</span>
                    </span>
                    <span class="count float-right">19篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10622945.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10622945.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">javascript</span>
                    </span>
                    <span class="count float-right">78篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11268762.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11268762.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210807173311729.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">Java小白入门200例</span>
                    </span>
                    <span class="count float-right">47篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11168573.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11168573.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20210704165828885.jpeg?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">从零学Java</span>
                    </span>
                    <span class="count float-right">16篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10671823.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10671823.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">java</span>
                    </span>
                    <span class="count float-right">17篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10640295.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10640295.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">jquery</span>
                    </span>
                    <span class="count float-right">15篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10738165.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10738165.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">canvas</span>
                    </span>
                    <span class="count float-right">42篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10650989.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10650989.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">vue</span>
                    </span>
                    <span class="count float-right">16篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10845519.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10845519.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">开发工具</span>
                    </span>
                    <span class="count float-right">8篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10846490.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10846490.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">IT新闻动态</span>
                    </span>
                    <span class="count float-right">1篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10846456.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10846456.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">吐槽</span>
                    </span>
                    <span class="count float-right">1篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10740151.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10740151.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">windows</span>
                    </span>
                    <span class="count float-right">1篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10622947.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10622947.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">实现js原生方法</span>
                    </span>
                    <span class="count float-right">14篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10649269.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10649269.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">mvvm</span>
                    </span>
                    <span class="count float-right">2篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10629047.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10629047.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">javascript基础</span>
                    </span>
                    <span class="count float-right">19篇</span>
                </a>
            </li>
            <li class="">
                <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10624412.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10624412.html","ab":"new"}'>
                    <img src="https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                    <span class="title oneline">
                        <span class="text">正则表达式</span>
                    </span>
                    <span class="count float-right">3篇</span>
                </a>
            </li>
        </ul>
    </div>
    <p class="text-center">
        <a class="flexible-btn" data-fbox="aside-archive"><img class="look-more" src="https://csdnimg.cn/release/blogv2/dist/pc/img/arrowDownWhite.png" alt=""></a>
    </p>
</div>
<div id="asideNewComments" class="aside-box">
    <h3 class="aside-title">最新评论</h3>
    <div class="aside-content">
        <ul class="newcomment-list">
            <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343654" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343654","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343654","ab":"new"}'>JavaScript实现2048小游戏，我终于赢了一把</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/dkm123456" class="user-name" target="_blank">编程界明世隐: </a>
                    <span class="code-comments">这个是我封装的一个游戏工具代码</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343483" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343483","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18343483","ab":"new"}'>JavaScript实现2048小游戏，我终于赢了一把</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/qq_39234709" class="user-name" target="_blank">qq_39234709: </a>
                    <span class="code-comments">[code=html]
const bg = new _.Rect({x:0,y:0,width:364,height:364,fill:true,fillStyle:&#39;#428853&#39;});
_.each(this.renderArr,function(item){
    item &amp;&amp; item.render(context);
  });
[/code]
弱弱问下，代码中 &ldquo;_&rdquo; 定义的是什么</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/dkm123456/article/details/120228893#comments_18342648" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18342648","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18342648","ab":"new"}'>JavaScript实现2048小游戏，我终于赢了一把</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/S_yyuan" class="user-name" target="_blank">铅华殿: </a>
                    <span class="code-comments">不错不错,博主这篇文章,内容很充实,期待下一篇博客,一键三联了,欢迎回访哦.</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/dkm123456/article/details/120228893#comments_18341215" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18341215","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/120228893#comments_18341215","ab":"new"}'>JavaScript实现2048小游戏，我终于赢了一把</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/huangbangqing12" class="user-name" target="_blank">《虚幻私塾》: </a>
                    <span class="code-comments">编程界明世隐，JavaScript实现2048小游戏，我终于赢了一把，大佬的文章让我受益颇多，欢迎来我博客指点！</span>
                </p>
            </li>
            <li>
                <a class="title text-truncate" target="_blank" href="https://blog.csdn.net/dkm123456/article/details/117047116#comments_18339200" data-report-click='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/117047116#comments_18339200","ab":"new"}' data-report-view='{"mod":"popu_542","spm":"1001.2101.3001.4231","dest":"https://blog.csdn.net/dkm123456/article/details/117047116#comments_18339200","ab":"new"}'>java植物大战僵尸，我家ADC直呼内行，甚至喊出辅助牛逼、666</a>
                <p class="comment ellipsis">
                    <a href="https://blog.csdn.net/qq_52778682" class="user-name" target="_blank">倾之若雨: </a>
                    <span class="code-comments">学习了，学习了，6</span>
                </p>
            </li>
        </ul>
    </div>
</div>
<div id="asideNewNps" class="aside-box">
    <h3 class="aside-title">您愿意向朋友推荐“博客详情页”吗？</h3>
    <div class="aside-content">
        <ul class="newnps-list">
            <li class="newnps-item" data-type="强烈不推荐">
                <div class="newnps-img-box">
                    <img class="newnps-img active" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeel1.png" alt="">
                    <img class="newnps-img default" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeelGrey1.png" alt="">
                </div>
                <div class="newnps-text">强烈不推荐</div>
            </li>
            <li class="newnps-item" data-type="不推荐">
                <div class="newnps-img-box">
                    <img class="newnps-img active" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeel2.png" alt="">
                    <img class="newnps-img default" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeelGrey2.png" alt="">
                </div>
                <div class="newnps-text">不推荐</div>
            </li>
            <li class="newnps-item" data-type="一般般">
                <div class="newnps-img-box">
                    <img class="newnps-img active" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeel3.png" alt="">
                    <img class="newnps-img default" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeelGrey3.png" alt="">
                </div>
                <div class="newnps-text">一般般</div>
            </li>
            <li class="newnps-item" data-type="推荐">
                <div class="newnps-img-box">
                    <img class="newnps-img active" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeel4.png" alt="">
                    <img class="newnps-img default" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeelGrey4.png" alt="">
                </div>
                <div class="newnps-text">推荐</div>
            </li>
            <li class="newnps-item" data-type="强烈推荐">
                <div class="newnps-img-box">
                    <img class="newnps-img active" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeel5.png" alt="">
                    <img class="newnps-img default" src="https://csdnimg.cn/release/blogv2/dist/pc/img/npsFeelGrey5.png" alt="">
                </div>
                <div class="newnps-text">强烈推荐</div>
            </li>
        </ul>
        <div class="newnps-form-box">
        <div class="newnps-form">
            <input type="text" placeholder="请输入建议或反馈后点击提交" class="newnps-input">
            <span class="newnps-btn">提交</span>
        </div>
        </div>
    </div>
</div>
<div id="asideArchive" class="aside-box" style="display:block!important; width:300px;">
    <h3 class="aside-title">最新文章</h3>
    <div class="aside-content">
        <ul class="inf_list clearfix">
            <li class="clearfix">
            <a href="https://blog.csdn.net/dkm123456/article/details/120228893" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://blog.csdn.net/dkm123456/article/details/120228893","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://blog.csdn.net/dkm123456/article/details/120228893","ab":"new"}'>JavaScript实现2048小游戏，我终于赢了一把</a>
            </li>
            <li class="clearfix">
            <a href="https://blog.csdn.net/dkm123456/article/details/120103509" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://blog.csdn.net/dkm123456/article/details/120103509","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://blog.csdn.net/dkm123456/article/details/120103509","ab":"new"}'>Java小白入门200例46之 foreach 语句</a>
            </li>
            <li class="clearfix">
            <a href="https://blog.csdn.net/dkm123456/article/details/120098101" target="_blank" data-report-click='{"mod":"popu_382","spm":"1001.2101.3001.4136","dest":"https://blog.csdn.net/dkm123456/article/details/120098101","ab":"new"}' data-report-view='{"mod":"popu_382","dest":"https://blog.csdn.net/dkm123456/article/details/120098101","ab":"new"}'>Java小白入门200例45之 for 语句详解</a>
            </li>
        </ul>
        <div class="archive-bar"></div>
        <div class="archive-box">
                <div class="archive-title">2021</div> 
                <div class="archive-content">
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/09" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/09"}'>
                        <span class="time">09月</span>
                        <span class="count">27篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/08" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/08"}'>
                        <span class="time">08月</span>
                        <span class="count">33篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/07" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/07"}'>
                        <span class="time">07月</span>
                        <span class="count">11篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/06" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/06"}'>
                        <span class="time">06月</span>
                        <span class="count">7篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/05" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/05"}'>
                        <span class="time">05月</span>
                        <span class="count">7篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/04" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/04"}'>
                        <span class="time">04月</span>
                        <span class="count">13篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/03" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/03"}'>
                        <span class="time">03月</span>
                        <span class="count">28篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/02" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/02"}'>
                        <span class="time">02月</span>
                        <span class="count">8篇</span>
                        </a>
                    </div>
                    <div class="archive-item">
                        <a href="https://blog.csdn.net/dkm123456/article/month/2021/01" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":"https://blog.csdn.net/dkm123456/article/month/2021/01"}'>
                        <span class="time">01月</span>
                        <span class="count">29篇</span>
                        </a>
                    </div>
                </div>
                <div class="archive-list-item"><a href="https://blog.csdn.net/dkm123456/article/month/2020/12" target="_blank" data-report-click='{"mod":"popu_538","spm":"1001.2101.3001.4138","ab":"new","dest":""}'><span class="year">2020年</span><span class="num">97篇</span></a></div>
        </div>
    </div>
</div>
	<div id="footerRightAds" class="isShowFooterAds">
		<div class="aside-box">
			<div id="kp_box_57" data-pid="57"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- PC-博客详情页-矩形-左下视窗（自适应） -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="1894159733"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=57&a=707&c=0&k=&spm=1001.2101.3001.5001&d=1&t=3&u=cf0091f6d90c41fe9bf0b33ae13b8809" style="display: block;width: 0px;height: 0px;"></div>
		</div>
	</div>
    <!-- 详情页显示目录 -->
<!--文章目录-->
<div id="asidedirectory" class="aside-box">
    <div class='groupfile' id="directory">
        <h3 class="aside-title">目录</h3>
        <div class="align-items-stretch group_item">
            <div class="pos-box">
            <div class="scroll-box">
                <div class="toc-box"></div>
            </div>
            </div>
        </div>
    </div>
</div>
</aside>
<script>
	$("a.flexible-btn").click(function(){
		$(this).parents('div.aside-box').removeClass('flexible-box');
		$(this).parents("p.text-center").remove();
	})
</script>
<script type="text/javascript"  src="https://g.csdnimg.cn/user-tooltip/2.5/user-tooltip.js"></script>
<script type="text/javascript"  src="https://g.csdnimg.cn/user-medal/1.0.7/user-medal.js"></script>    </div>
<div class="recommend-right  align-items-stretch clearfix" id="rightAside" data-type="recommend">
    <aside class="recommend-right_aside">
        <div id="recommend-right" >
                        <div class='flex-column aside-box groupfile' id="groupfile">
                <div class="groupfile-div">
                <h3 class="aside-title">目录</h3>
                <div class="align-items-stretch group_item">
                    <div class="pos-box">
                        <div class="scroll-box">
                            <div class="toc-box"></div>
                        </div>
                    </div>
                </div>
                </div>
            </div>
                <div id="recommendAdBox">
                    <div id="kp_box_479" data-pid="479"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- PC-博客详情页-右侧视窗（自适应） -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1076724771190722"
     data-ad-slot="3484057394"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script><img class="pre-img-lasy" data-src="https://kunyu.csdn.net/1.png?p=479&a=3267&c=0&k=&spm=1001.2101.3001.4834&d=1&t=3&u=f6af06d2840e4e95894a0ff83c30e57f" style="display: block;width: 0px;height: 0px;"></div>
                </div>
            <div class='aside-box kind_person d-flex flex-column'>
                    <h3 class="aside-title">分类专栏</h3>
                    <div class="align-items-stretch kindof_item" id="kind_person_column">
                        <div class="aside-content">
                            <ul>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085592.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085592.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210723110743428.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Java游戏实例大全</span>
                                            <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                                        </span>
                                        <span class="count float-right">12篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085433.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085433.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210524191943772.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">java web项目实战</span>
                                            <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                                        </span>
                                        <span class="count float-right">6篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11085472.html" data-report-click='{"mod":"popu_826","spm":"1001.2101.3001.4230","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11085472.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210524185108211.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">javascript精彩实例</span>
                                            <img class="tip" src="https://csdnimg.cn/release/blogv2/dist/pc/img/payMoney.png" alt="">
                                        </span>
                                        <span class="count float-right">23篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10722701.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10722701.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210704165918193.jpeg?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">java项目实战</span>
                                        </span>
                                        <span class="count float-right">19篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10622945.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10622945.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">javascript</span>
                                        </span>
                                        <span class="count float-right">78篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11268762.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11268762.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210807173311729.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">Java小白入门200例</span>
                                        </span>
                                        <span class="count float-right">47篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_11168573.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_11168573.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20210704165828885.jpeg?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">从零学Java</span>
                                        </span>
                                        <span class="count float-right">16篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10671823.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10671823.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">java</span>
                                        </span>
                                        <span class="count float-right">17篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10640295.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10640295.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">jquery</span>
                                        </span>
                                        <span class="count float-right">15篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10738165.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10738165.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">canvas</span>
                                        </span>
                                        <span class="count float-right">42篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10650989.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10650989.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">vue</span>
                                        </span>
                                        <span class="count float-right">16篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10845519.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10845519.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">开发工具</span>
                                        </span>
                                        <span class="count float-right">8篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10846490.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10846490.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">IT新闻动态</span>
                                        </span>
                                        <span class="count float-right">1篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10846456.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10846456.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">吐槽</span>
                                        </span>
                                        <span class="count float-right">1篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10740151.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10740151.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">windows</span>
                                        </span>
                                        <span class="count float-right">1篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10622947.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10622947.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">实现js原生方法</span>
                                        </span>
                                        <span class="count float-right">14篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10649269.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10649269.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">mvvm</span>
                                        </span>
                                        <span class="count float-right">2篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10629047.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10629047.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">javascript基础</span>
                                        </span>
                                        <span class="count float-right">19篇</span>
                                    </a>
                                </li>
                                <li class="">
                                    <a class="clearfix" target="_blank" href="https://blog.csdn.net/dkm123456/category_10624412.html" data-report-click='{"mod":"popu_537","spm":"1001.2101.3001.4137","strategy":"pc付费专栏左侧入口","dest":"https://blog.csdn.net/dkm123456/category_10624412.html","ab":"new"}'>
                                        <img src="https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64" alt="" onerror="this.src='https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64'">
                                        <span class="title oneline">
                                            <span class="text">正则表达式</span>
                                        </span>
                                        <span class="count float-right">3篇</span>
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
            </div>
        </div>
    </aside>
</div>

</div>
<div class="mask-dark"></div>
<script type="text/javascript">
    var timert = setInterval(function(){
      sideToolbar = $(".csdn-side-toolbar");
      if (sideToolbar.length > 0) {
        sideToolbar.css('cssText','bottom:64px !important;')
        clearInterval(timert);
      }
    }, 200);
</script>
<script>
    var articleId = 117675468;
    var commentscount = 278;
    var curentUrl = "https://blog.csdn.net/dkm123456/article/details/117675468";
    var myUrl = "https://my.csdn.net/";
    var highlight = ["老","程序员","年代","周末","俄罗斯方块","中学","花","swing","java","连接","游戏"];//高亮数组
    var isRecommendModule = true;
    var isBaiduPre = true;
    var baiduCount = 2;
    var share_card_url = "https://blog.csdn.net/dkm123456/article/shareArticleCardPage?article_id=117675468"
	var articleType = 1;
    var baiduKey = "Java俄罗斯方块，老程序员花了一个周末，连接中学年代！";
    var userNewReport = false;
    var needInsertBaidu = true;
    var recommendRegularDomainArr = ["blog.csdn.net/.+/article/details/","download.csdn.net/download/","edu.csdn.net/course/detail/","ask.csdn.net/questions/","bbs.csdn.net/topics/","www.csdn.net/gather_.+/"]
    var codeStyle = "dracula";
    var baiduSearchType = "title";
    var canRead = true;
    var blogMoveHomeArticle = false;
    var showPcWindowAd = false;
    var showSearchText = "";
    var linkPage = true;
    var articleSource = 1;
    var articleReport = '{"pid": "blog", "spm":"1001.2101"}';
    var isShowToQuestion = false;
    var baiduSearchChannel = 'pc_relevant'
    var baiduSearchIdentification = '.no_search_link'
    var initRewardObject = {
        giver: currentUserName,
        anchor: username,
        articleId: articleId,
        sign: ''
    }
</script>
<script src="https://csdnimg.cn/public/sandalstrap/1.4/js/sandalstrap.min.js"></script>
<div class="skin-boxshadow"></div>
<div class="directory-boxshadow"></div>
<div class="pay-code">
    <div class="pay-money">实付<span class="pay-money-span" data-nowprice='' data-oldprice=''>元</span></div>
    <div class="content-blance"><a class="blance-bt" href="javascript:;">使用余额支付</a></div>
    <div class="content-code">
    <div id="payCode" data-id="">
            <div class="renovate">
                <img src="https://csdnimg.cn/release/blogv2/dist/pc/img/pay-time-out.png">
                <span>点击重新获取</span>
            </div>
        </div>
        <div class="pay-style"><span><img src="https://csdnimg.cn/release/blogv2/dist/pc/img/weixin.png"></span><span><img src="https://csdnimg.cn/release/blogv2/dist/pc/img/zhifubao.png"></span><span><img src="https://csdnimg.cn/release/blogv2/dist/pc/img/jingdong.png"></span><span class="text">扫码支付</span></div>
    </div>
    <div class="bt-close"><svg t="1567152543821" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10924" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12"><defs><style type="text/css"></style></defs><path d="M512 438.378667L806.506667 143.893333a52.032 52.032 0 1 1 73.6 73.621334L585.621333 512l294.485334 294.485333a52.074667 52.074667 0 0 1-73.6 73.642667L512 585.621333 217.514667 880.128a52.053333 52.053333 0 1 1-73.621334-73.642667L438.378667 512 143.893333 217.514667a52.053333 52.053333 0 1 1 73.621334-73.621334L512 438.378667z" fill="" p-id="10925"></path></svg></div>
    <!-- <p style="margin-top: 8px;font-size: 14px;" class="text-center">支付成功即可阅读</p> -->
    <div class="pay-balance">
    <input type="radio" class="pay-code-radio" data-type="details"> 
    <span class="span">钱包余额</span>
    <span class="balance" style="color:#FC5531;font-size:14px;">0</span>  
    <div class="pay-code-tile">
        <img src="https://csdnimg.cn/release/blogv2/dist/pc/img/pay-help.png" alt="">
        <div class="pay-code-content">
            <div class="span">
                <p class="title">抵扣说明：</p>
                <p> 1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。<br> 2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。</p>
            </div>
        </div>
    </div>
    </div>
    <a class="pay-balance-con" href="https://i.csdn.net/#/wallet/balance/recharge" target="_blank"><img src="https://csdnimg.cn/release/blogv2/dist/pc/img/recharge.png" alt=""><span  >余额充值</span></a>
</div>
<div style="display:none;">
	<img src="" onerror='setTimeout(function(){if(!/(csdn.net|iteye.com|baiducontent.com|googleusercontent.com|360webcache.com|sogoucdn.com|bingj.com|baidu.com)$/.test(window.location.hostname)){window.location.href="\x68\x74\x74\x70\x73\x3a\x2f\x2f\x77\x77\x77\x2e\x63\x73\x64\x6e\x2e\x6e\x65\x74"}},3000);'>
</div>
</body>
<script src="https://csdnimg.cn/release/blogv2/dist/components/js/pc_wap_highlight-db1e81323a.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/components/js/pc_wap_common-6a9acd4c62.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/components/js/edit_copy_code-1320dfe85c.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://csdnimg.cn/release/blog_editor_html/release1.6.12/ckeditor/plugins/codesnippet/lib/highlight/styles/dracula.css">
<script>
 // 全局声明
 if (window.csdn === undefined) {
      window.csdn = {};
    }
    window.csdn.sideToolbar = {
        options: {
            report:{
                isShow: true,
            },
            qr: {
                isShow: false,
            },
            guide: {
                isShow: true
            }
        }
    }
    $(function(){
        $(document).on('click',"a.option-box[data-type='report']",function() {
            window.csdn.userLogin.loadAjax(function(res){
                if(userNewReport){
                    showReportNew(false,articleTitles);
                }else{
                    showReport(false,articleTitles);
                }
            })
        });
    })
</script>
    <script src="https://g.csdnimg.cn/baidu-search/1.0.9/baidu-search.js"  type="text/javascript"></script>
<script src="https://csdnimg.cn/release/download/old_static/js/qrcode.js"></script>
<script src="https://g.csdnimg.cn/lib/qrcode/1.0.0/qrcode.min.js"></script>
<script src="https://g.csdnimg.cn/user-ordercart/2.0.6/user-ordercart.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/user-ordertip/4.1.3/user-ordertip.js" type="text/javascript" ></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/common-24fa4dcb20.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/detail-44f0825236.min.js" type="text/javascript"></script>
<script src="https://csdnimg.cn/release/blogv2/dist/pc/js/column-8eca907613.min.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/side-toolbar/3.0/side-toolbar.js" type="text/javascript"></script>
<script>
window.csdn.extensionBox = window.csdn.extensionBox ? window.csdn.extensionBox : {};
window.csdn.extensionBox.extensionBoxParams = {
    inited: function () {
    var extensionBox = document.getElementById('blogExtensionBox'); // 位置dom元素
    window.csdn.extensionBox.show({
        isdark:false, // 是否黑皮肤
        voteusername: "dkm123456",
        posDom: extensionBox, // 插入位置 selectorString || 位置dom元素
        codyFn:()=>{
        //复制成功回调函数
            showToast({
                text: '复制成功!',
                bottom: '10%', //toast距离页面底部的距离
                zindex: 9000, //为了防止被其他控件遮盖，z-index默认为2
                speed: 500, //toast的显示速度
                time: 1500//toast显示多久以后消失
            });
        }
    });
    }
}
</script>
<script src="https://g.csdnimg.cn/extension-box/1.1.3/extension-box.js" type="text/javascript"></script>
<script src="https://g.csdnimg.cn/copyright/1.0.4/copyright.js" type="text/javascript"></script>
<script>
    $(".MathJax").remove();
    if ($('div.markdown_views pre.prettyprint code.hljs').length > 0) {
        $('div.markdown_views')[0].className = 'markdown_views';
    }
</script>
<script type="text/javascript" src="https://csdnimg.cn/release/blog_mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
            "HTML-CSS": {
                    linebreaks: { automatic: true, width: "94%container" },
                    imageFont: null
            },
            tex2jax: {
                preview: "none",
                ignoreClass:"title-article"
            },
            mml2jax: {
                preview: 'none'
            }
    });
</script>
<script type="text/javascript" crossorigin src="https://g.csdnimg.cn/login-box/1.1.7/login-box.js"></script></html>
